Closed ajjack50n closed 3 years ago
Hey can someone show me how to use async with ...
const handler = nc({ attachParams: true }); handler.get("/users/:userId/posts/:postId", (req, res) => { // Visiting '/users/12/posts/23' will render '{"userId":"12","postId":"23"}' res.send(req.params); });
I don't seem to be able to make this work. I want to use await when calling Sequelize with the handler.
ignore.. solution obvious!:)
handler.get("/users/:userId/posts/:postId", async (req, res) => { // Visiting '/users/12/posts/23' will render '{"userId":"12","postId":"23"}' res.send(req.params); });
Hey can someone show me how to use async with ...
I don't seem to be able to make this work. I want to use await when calling Sequelize with the handler.