6 ms·
Express is ripe to be replaced. It has the weirdest syntax I've ever seen and is basically designed around call back hell. I can't wait till somebody rebuilds
by slackingoff2017 9y ago
Express is ripe to be replaced. It has the weirdest syntax I've ever seen and is basically designed around call back hell.
I can't wait till somebody rebuilds it in Typescript or at least around async
- always_good 9y agohttp://koajs.com/ http://koajs.com/ In Koa, handlers don't respond to the request. Instead, they update a representation of the response and return a promise. The response bubbles up to the top-level where the `res.send()` is done. This way you have real middleware. You can post-process the response or do something else entirely after the downstream has run. const middleware = async (ctx, next) => { console.log('request going down') await next() console.log('request coming up') }
- slackingoff2017 9y agoHaha this is exactly how I pictured it working! Made by the makers of express too.