You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know whether it's a bug or feature request. My case is as follows:
I have an async route
server.get("/verify", async (req, res) => {}
containing interaction with MongoDB via Mongoose. In that route I need to use res.redirect, which won't work, because, apparently, it needs "next", which is not declared in async routes.
I tried going the ugly "Callback Hell" way and rewriting everything without await/async, but, apparently, Mongoose no longer supports callbacks - for all the good reasons. It gave an error:
MongooseError: Model.findOne() no longer accepts a callback
Please help with an advice how to make res.redirect work in async routes.
The text was updated successfully, but these errors were encountered:
Hello Restify!
Don't know whether it's a bug or feature request. My case is as follows:
I have an async route
server.get("/verify", async (req, res) => {}
containing interaction with MongoDB via Mongoose. In that route I need to use res.redirect, which won't work, because, apparently, it needs "next", which is not declared in async routes.
I tried going the ugly "Callback Hell" way and rewriting everything without await/async, but, apparently, Mongoose no longer supports callbacks - for all the good reasons. It gave an error:
MongooseError: Model.findOne() no longer accepts a callback
Please help with an advice how to make res.redirect work in async routes.
The text was updated successfully, but these errors were encountered: