Live data from Hacker News

Show HN: Server.js – A modern Express alternative

serverjs.io

41–50 of 124 posts

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

#41
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…

Totally agree with you. I miss the opinionated nature of Rails when I work in the JS world.

I think it's always just going to be a different-strokes thing.

For example, I left the Rails world hungering for tiny, composable solutions like Clojure's Ring and Node's Koa.

I ended up preferring to just see glue code in my git diffs. For me and the small teams I work on, there's a lot of productivity to be gained when you can just look at the code and understand what's going on.

You end up with bespoke glue code per application, but the glue is generally simple so I didn't reap much reward from using a framework that tries to hide it at all cost.

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

#42
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…

    rate-limiting -> nginx || iptables
Never ask PHP/Node/Ruby/Python to do low-level network routing. Your throwing megabytes of memory at a simple connection decision. If you need advanced logic for rate-limiting (not just access counting) then using nginx + memcached/redis as the marker. Have your app mark the ip in memcached/redis so nginx knows not to bother Node/PHP/Ruby/Python next time.

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

#43
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…

rate-limiting -> nginx || iptables Never ask PHP/Node/Ruby/Python to do low-level network routing. Your throwing megabytes of memory at a simple connection decision. If you need advanced logic for rate-limiting (not just access counting) then using nginx + memcached/redis as the marker. Have your app mark the ip in memcached/redis so nginx knows not to bother Node/PHP/Ruby/Python next time.

What you propose is only a performance optimization at the expense of operational complexity. Like caching.

"Never" doesn't make sense.

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

#44

Earlier quoted context omitted.

rate-limiting -> nginx || iptables Never ask PHP/Node/Ruby/Python to do low-level network routing. Your throwing megabytes of memory at a simple connection decision. If you need advanced logic for rate-limiting (not just access counting) then using nginx + memcached/redis as the marker. Have your app mark the ip in memcached/redis so nginx knows not to bother Node/PHP/Ruby/Python next time.

What you propose is only a performance optimization at the expense of operational complexity. Like caching. "Never" doesn't make sense.

I guess you could simply rate-limit your login/signup if your not worried about a DoS and just want to keep people from brute-forcing a password.

On the other hand, it's not simply "a performance optimization" as there is no way for node to handle a DDoS without crazy amounts of hardware relative to what iptables|nginx can handle.

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

#45

Earlier quoted context omitted.

I went from hapi to express simply for the plethora of middleware (specifically passport).

Really? Hapi has its request lifecycle and built-in auth that makes auth much simpler than injecting authentication/authorization middlewares on every route.

agree,also hapi has a pretty big ecosystem of middleware. a lot of it 1st party

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

#46
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…

Changing the syntax is really useful to avoid Callback Hell by leveraging async/await: http://callbackhell.com/

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

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

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

#50

Earlier quoted context omitted.

What you propose is only a performance optimization at the expense of operational complexity. Like caching. "Never" doesn't make sense.

I guess you could simply rate-limit your login/signup if your not worried about a DoS and just want to keep people from brute-forcing a password. On the other hand, it's not simply "a performance optimization" as there is no way for node to handle a DDoS without crazy amounts of hardware relative to what iptables|nginx can handle.

[deleted]
Post reply on HN