Show HN: Server.js – A modern Express alternative
71–80 of 124 posts
Re: Show HN: Server.js – A modern Express alternative
#72Does passport plug into this?
Re: Show HN: Server.js – A modern Express alternative
#73Re: Show HN: Server.js – A modern Express alternative
#74I can't wait till somebody rebuilds it in Typescript or at least around async
Re: Show HN: Server.js – A modern Express alternative
#75Re: Show HN: Server.js – A modern Express alternative
#76Express 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
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')
}Re: Show HN: Server.js – A modern Express alternative
#77Rather than changing express's syntax, I would much rather have a better express boilerplate generator with an opinionated stack with good documentation/justification. I recently started learning express/node and wasted weeks googling for blog posts for each dependency to figure out how to configure them. I guess this is somewhat valuable for end-to-end understanding but not for productivity. There are a bunch depend…
> I would be so happy if someone took away my power to choose and just forced me to use something that will "just work". You are looking for django/ruby on rails.
Re: Show HN: Server.js – A modern Express alternative
#78Haven't used it in production but replaced Express with it in some side projects.
Since server.js is built on top of express it might even be possible to build a variant of it on Fastify instead and get those benefits as well.
Re: Show HN: Server.js – A modern Express alternative
#79Rather than changing express's syntax, I would much rather have a better express boilerplate generator with an opinionated stack with good documentation/justification. I recently started learning express/node and wasted weeks googling for blog posts for each dependency to figure out how to configure them. I guess this is somewhat valuable for end-to-end understanding but not for productivity. There are a bunch depend…
That's basically what Google did on the front end with Angular for people who had the exact same problem with React. Maybe we'll see something like this happen on Backend Javascript, I mean there is Sails, but it doesn't "just work" as well as Angular does on the frontend.
Re: Show HN: Server.js – A modern Express alternative
#80Rather than changing express's syntax, I would much rather have a better express boilerplate generator with an opinionated stack with good documentation/justification. I recently started learning express/node and wasted weeks googling for blog posts for each dependency to figure out how to configure them. I guess this is somewhat valuable for end-to-end understanding but not for productivity. There are a bunch depend…
Isn't Sails just that: https://sailsjs.com/