mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-10-11 14:27:15 +08:00
simple api log
This commit is contained in:
parent
3d8122fa4a
commit
f44aa6f655
1 changed files with 5 additions and 1 deletions
6
api.js
6
api.js
|
@ -60,7 +60,6 @@ server.use((req, res, next) => {
|
||||||
if (req.route.path === '/users/:user/updates') {
|
if (req.route.path === '/users/:user/updates') {
|
||||||
req.headers['accept-encoding'] = '';
|
req.headers['accept-encoding'] = '';
|
||||||
}
|
}
|
||||||
log.http(req.method, req.url);
|
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
server.use(restify.plugins.gzipResponse());
|
server.use(restify.plugins.gzipResponse());
|
||||||
|
@ -145,6 +144,11 @@ module.exports = done => {
|
||||||
submitRoutes(db, server, messageHandler, userHandler);
|
submitRoutes(db, server, messageHandler, userHandler);
|
||||||
domainaliasRoutes(db, server);
|
domainaliasRoutes(db, server);
|
||||||
|
|
||||||
|
server.use((req, res, next) => {
|
||||||
|
log.http(req.method, '%s - %s %s', req.url, res.statusCode, req.connection.remoteAddress);
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
server.on('error', err => {
|
server.on('error', err => {
|
||||||
if (!started) {
|
if (!started) {
|
||||||
started = true;
|
started = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue