mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
logging improvements
This commit is contained in:
parent
9f75d1d96f
commit
373cb4db71
5 changed files with 15 additions and 5 deletions
|
@ -57,6 +57,12 @@ function GetApp(): ModuleType {
|
|||
exceptions: ['/favicon.ico', '/getVeteranPw'],
|
||||
})
|
||||
)
|
||||
app.use((req: Request, res, next) => {
|
||||
if (req.url.includes('.html')) {
|
||||
logger.LogReq(req)
|
||||
}
|
||||
next()
|
||||
})
|
||||
publicdirs.forEach((pdir) => {
|
||||
logger.Log(`Using public dir: ${pdir}`)
|
||||
app.use(express.static(pdir))
|
||||
|
@ -84,7 +90,6 @@ function GetApp(): ModuleType {
|
|||
routes.forEach((route) => {
|
||||
logger.DebugLog(`Added route /${route}`, 'DataEditor routes', 1)
|
||||
app.get(`/${route}`, function(req: Request, res) {
|
||||
logger.LogReq(req)
|
||||
res.redirect(`${route}.html`)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue