Live data from Hacker News

Show HN: Server.js – A modern Express alternative

serverjs.io

121–124 of 124 posts

Re: Show HN: Server.js – A modern Express alternative

#121

no mention of TLS, which is unfortunate

Why? TLS/SSL termination is normally (at least on every project I've worked with) handled by the web server.

Exactly, it was initially intended to be a core feature but after searching around (and from my experiences) I found out it is rarely done at the language-level.

Re: Show HN: Server.js – A modern Express alternative

#122

I'd argue koajs was the first modern express alternative, although it's arguably more of a connect alternative. I've been happily using it since generators were available under a flag with node 0.11 and it has always been a joy. There's a huge list of middleware [0] on their wiki, and you just pull in whatever you need. It means that your initial setup takes a bit longer, but it forces you to understand all the movin…

I didn't know about that middleware list, thanks for sharing. About session rotation, it was my impression that it is a smaller problem compared to how it can be exploited if we're using cookies [1][2], could you share some more info about it please? About Redis, I totally agree. You can add any store that you want with the plain `{ session: { store: ... } }` option. There is an issue though for some of them that nee…

Note: socket.io is stable; I mean the internal glue for using socket.io with server.js

Re: Show HN: Server.js – A modern Express alternative

#124

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

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') a…

Haha this is exactly how I pictured it working! Made by the makers of express too.
Post reply on HN