Closed literakl closed 4 years ago
Hi @literakl
Thanks for issue, but this issue looks like a question, there you first asking about this and i think you should debug or wait to someone who already fixed issue. Nanoexpress provided as-is for default version, as option, if you need fast support with solution, you should become sponsor.
Thanks again for interest
Can I make a feature request - input/output logger? It is nightmare to investigate the issues when I have no idea why nanoexpress does not send any response.
Yes, you can create middleware for handling these, but core of project should be same as current
Do you mean something like this?
function logRequest(req, res, cb) { console.log("req = ", req); console.log("res = ", res); cb(); } app.use(logRequest);
Is it put on start or end of middlewares?
Yes, could be like that. Both on start and end works, but I recommend at end because of all methods and properties should be attached
app.use(logRequest) will put this middleware at start. How can I add it to the end for all requests? Thank you
If you want after all requests including routes itself, I think it is impossible, but before route, you can add it.
Like app.get(path, yourMiddleware, yourRoute)
I fight with Chrome hiding errors: https://stackoverflow.com/questions/60917740/chrome-developer-is-hiding-status-and-response
Is there any way how to turn a raw request and response logging in Nanoexpress?