mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Authetication, logger middleware, db create tool
This commit is contained in:
parent
5f0b17a0db
commit
ebd27f93c1
11 changed files with 164 additions and 94 deletions
utils
|
@ -125,7 +125,14 @@ function LogReq (req, toFile, sc) {
|
|||
hostname = 'NOHOST'
|
||||
Log('req.hostname is undefined! req.hostname: ' + req.hostname, GetColor('redbg'))
|
||||
}
|
||||
logEntry += dl + hostname + dl + req.headers['user-agent'] + dl + req.method + dl
|
||||
logEntry += dl +
|
||||
hostname + dl +
|
||||
req.headers['user-agent'] + dl +
|
||||
req.method + dl
|
||||
|
||||
if (req.session && req.session.user) {
|
||||
logEntry += C('cyan') + req.session.user.id + C() + dl
|
||||
}
|
||||
|
||||
logEntry += GetRandomColor(req.url.split('?')[0]) + req.url
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue