logging improvements, logging "/" now

This commit is contained in:
mrfry 2021-02-16 11:08:38 +01:00
parent 373cb4db71
commit 23fcb48fcd
3 changed files with 6 additions and 3 deletions

View file

@ -25,7 +25,8 @@
"scripts": {
"start": "node ./dist/server.js",
"dev": "npm run build && NS_DEVEL=1 NS_NOUSER=1 NS_LOGLEVEL=1 node ./dist/server.js",
"build": "tsc && bash -c './scripts/postBuild.sh'"
"build": "tsc && bash -c './scripts/postBuild.sh'",
"export": "tsc && bash -c './scripts/postBuild.sh'"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.8.1",

View file

@ -58,7 +58,8 @@ function GetApp(): ModuleType {
})
)
app.use((req: Request, res, next) => {
if (req.url.includes('.html')) {
const url = req.url.split('?')[0]
if (url.includes('.html') || url === '/') {
logger.LogReq(req)
}
next()

View file

@ -66,7 +66,8 @@ function GetApp(): ModuleType {
})
)
app.use((req: Request, res, next) => {
if (req.url.includes('.html')) {
const url = req.url.split('?')[0]
if (url.includes('.html') || url === '/') {
logger.LogReq(req)
}
next()