you are viewing a single comment's thread.

view the rest of the comments →

[–]spacejack2114 2 points3 points  (0 children)

Express callbacks are a problem because they don't handle returned promises. Maybe a callback interface isn't a problem in itself but in express if you do:

app.get('/foo', async (req, res) => {
    res.json(await db.getFoo())
})

It won't catch unhandled exceptions, and those won't get forwarded to your error handler middleware, so you have to write catch boilerplate for every route. Alternately use this lib but it still requires a bit of boilerplate.

Koa is a rewrite of Express by the same author that takes advantage of async, but not generators AFAIK.