todo: 获取IP

main
Lei OT 10 months ago
parent 36b9ca191c
commit 927a3a3aab

@ -16,6 +16,7 @@ const rlog = require('./middleware/request_log');
// error handler // error handler
onerror(app) onerror(app)
// app.proxy = true;
app.use(log4js); app.use(log4js);
// middlewares // middlewares
app.use(bodyparser({ app.use(bodyparser({
@ -34,13 +35,13 @@ app.use(views(__dirname + '/views', {
app.use(rlog); app.use(rlog);
// logger // logger debug:
app.use(async (ctx, next) => { // app.use(async (ctx, next) => {
const start = new Date() // const start = new Date()
await next() // await next()
const ms = new Date() - start // const ms = new Date() - start
console.log(`${ctx.method} ${ctx.url} - ${ms}ms`) // console.log(`${ctx.method} ${ctx.url} - ${ms}ms`)
}) // })
// schedule jobs // schedule jobs
// syncAids(); // syncAids();

Loading…
Cancel
Save