mirror of
https://gitlab.com/MrFry/mrfrys-node-server
synced 2025-04-01 20:24:18 +02:00
Added Request type with cookies and session, and fixed stuff that it broke
This commit is contained in:
parent
865e97a754
commit
3b902d736f
9 changed files with 117 additions and 95 deletions
|
@ -39,6 +39,8 @@ const DELIM = C('green') + '|' + C()
|
|||
|
||||
// import express from 'express'
|
||||
import utils from '../utils/utils'
|
||||
import { Request } from '../types/basicTypes'
|
||||
|
||||
const vlogDir = './stats/vlogs/'
|
||||
const logDir = './stats/logs/'
|
||||
const statFile = 'stats/stats'
|
||||
|
@ -109,13 +111,10 @@ function Log(msg: string | object, color?: string): void {
|
|||
)
|
||||
}
|
||||
|
||||
function LogReq(
|
||||
req: any /*express.Request*/,
|
||||
toFile?: boolean,
|
||||
statusCode?: string
|
||||
): void {
|
||||
function LogReq(req: Request, toFile?: boolean, statusCode?: string): void {
|
||||
try {
|
||||
const ip = req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
const ip: any =
|
||||
req.headers['cf-connecting-ip'] || req.connection.remoteAddress
|
||||
|
||||
const nolog = noLogips.some((noLogip) => {
|
||||
return ip.includes(noLogip)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue