wiki-server 0.26.0-rc.9 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/random_id.js +0 -1
- package/lib/server.js +19 -5
- package/package.json +2 -2
package/lib/random_id.js
CHANGED
package/lib/server.js
CHANGED
|
@@ -135,6 +135,8 @@ export default async argv => {
|
|
|
135
135
|
|
|
136
136
|
app.startOpts = argv
|
|
137
137
|
|
|
138
|
+
const wikiName = new URL(argv.url).hostname
|
|
139
|
+
|
|
138
140
|
const log = (...stuff) => {
|
|
139
141
|
if (argv.debug) console.log(stuff)
|
|
140
142
|
}
|
|
@@ -254,10 +256,22 @@ export default async argv => {
|
|
|
254
256
|
|
|
255
257
|
// use logger, at least in development, probably needs a param to configure (or turn off).
|
|
256
258
|
// use stream to direct to somewhere other than stdout.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
259
|
+
const vhost = colorString(wikiName)
|
|
260
|
+
app.use(
|
|
261
|
+
logger((tokens, req, res) => {
|
|
262
|
+
return [
|
|
263
|
+
vhost,
|
|
264
|
+
tokens.method(req, res),
|
|
265
|
+
tokens.url(req, res),
|
|
266
|
+
tokens.status(req, res),
|
|
267
|
+
tokens.res(req, res, 'content-length'),
|
|
268
|
+
'-',
|
|
269
|
+
tokens['response-time'](req, res),
|
|
270
|
+
'ms',
|
|
271
|
+
].join(' ')
|
|
272
|
+
}),
|
|
273
|
+
)
|
|
274
|
+
|
|
261
275
|
app.use(cookieParser())
|
|
262
276
|
app.use(bodyParser.json({ limit: argv.uploadLimit }))
|
|
263
277
|
app.use(bodyParser.urlencoded({ extended: true, limit: argv.uploadLimit }))
|
|
@@ -495,7 +509,7 @@ export default async argv => {
|
|
|
495
509
|
if (!err) {
|
|
496
510
|
res.sendFile(favLoc, { dotfiles: 'allow' })
|
|
497
511
|
} else {
|
|
498
|
-
res.sendFile(defaultFavLoc)
|
|
512
|
+
res.sendFile(defaultFavLoc, { dotfiles: 'allow' })
|
|
499
513
|
}
|
|
500
514
|
})
|
|
501
515
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wiki-server",
|
|
3
3
|
"description": "A Federated Wiki Server",
|
|
4
|
-
"version": "0.26.
|
|
4
|
+
"version": "0.26.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Ward Cunningham",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@eslint/js": "^9.39.1",
|
|
60
60
|
"eslint": "^9.39.1",
|
|
61
|
-
"globals": "^
|
|
61
|
+
"globals": "^17.2.0",
|
|
62
62
|
"grunt-git-authors": "^3.2.0",
|
|
63
63
|
"prettier": "^3.7.3",
|
|
64
64
|
"supertest": "^7.1.4",
|