Live data from Hacker News

Show HN: Server.js – A modern Express alternative

serverjs.io

71–80 of 124 posts

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

#76

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')
      await next()
      console.log('request coming up')
    }

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

#77
post #49
post #32

Rather 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.

Or Laravel

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

#78
Fastify is a similar project that aims to be faster than Express and adds a number of API improvements like baked-in schema validation for routes, logging, and async-by-default APIs.

Haven'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.

https://www.fastify.io/

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

#79
post #32

Rather 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".

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

#80
post #66
post #32

Rather 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/

Yes but not with the "just work" part
Post reply on HN