do log after request is done

This commit is contained in:
HorizonCode 2023-05-12 12:55:31 +02:00
parent e3e5f8c1d2
commit 5626782178

View File

@ -22,9 +22,8 @@ httpServer.preprocessor((_req, rep) => {
});
httpServer.middleware(async (req, _rep, done) => {
console.log(`${req.method} - ${req.remoteIpAddr} - ${req.path}`);
const processTime = await done();
console.log(`Processed in ${prettyTime(processTime)}`);
console.log(`${req.method} - ${req.remoteIpAddr} - ${req.path} - ${prettyTime(processTime)}`);
});
httpServer.error((req, _rep) => {