Live data from Hacker News

Show HN: Server.js – A modern Express alternative

serverjs.io

51–60 of 124 posts

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

#51
Are there docs or maybe a blog post that identifies the value-add on top of Express? While I see the API design example (which applies to me), we already do that with Express v4 (it's more code organization than anything else.)

I'm super-interested, but I'd like to know at a deeper level what this gets us over plain Express.

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

#52

This pulls in over 200 dependencies, with a total weight of 37MB. I'll pass.

Only 37MB? I expected more TBH, I guess I am too used to the dev side of it. 37MB is really cheap compared to the hours that you save by not doing everything manually, even more when you consider the quality of the underlying libraries from a security point of view.

Long-term I would like to reduce this and have some ideas in mind, but right now this is not an issue.

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

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

https://feathersjs.com/, https://github.com/zeit/next.js/, and https://github.com/jedireza/aqua/ handle more of this for you without turning into the black-box Meteor.js.

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

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

You're looking for Adonisjs.

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

#55
post #36
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 a tangent but, don’t use moment.js! It inherits some of the parsing and other quirks from the awfulness that is the JS Date object, the mutability almost certainly will lead to being bit by a couple of bugs before you actually internalize it, and the time zone support is kind of tacked on as an afterthought. I highly recommend js-joda, particularly if you’ll ever be computing/showing things to your users in d…

I've always been of the opinion that timestamps should be stored UTC datetime or unix timestamp on the server side and then displayed to the proper locale by the client's device. Is this not a good method?

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

#56
post #36

Earlier quoted context omitted.

Totally a tangent but, don’t use moment.js! It inherits some of the parsing and other quirks from the awfulness that is the JS Date object, the mutability almost certainly will lead to being bit by a couple of bugs before you actually internalize it, and the time zone support is kind of tacked on as an afterthought. I highly recommend js-joda, particularly if you’ll ever be computing/showing things to your users in d…

I haven't tried it, but https://date-fns.org/ looks nice. For example, immutable API and just uses native Date objects.

Yeah it looks nicely simple & modular, but it probably works best in Node.js since your servers can all be in UTC.

In general I see the appeal of using a small shim around a standard library thing rather than re-implementing something totally new, but JS Date is bad enough that you're better off staying away altogether. It's just hard to use correctly since there's no "timezone unaware" object available and it always assumes the local timezone, so users' browsers in different timezones treat them differently. Lots of seemingly simple things (e.g. a time + timezone input picker) are easy to mess up because you end up accidentally implicitly converting things to the local time.

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

#57

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.

You're the one talking about DoS.

Notice how "rate-limiting" is a much more generic concept.

For example, Hacker News rate-limits the amount of posts you can make in a window of time. That's not because they think you're trying to DoS them.

Post reply on HN