HACKER Q&A
📣 hakanshehuu

From your experience, would you still choose Node.js for API?


To all of you who worked on a project that uses NodeJS for their backend API:

- Would you still choose it for your next project? - If yes, why? - If no, why? What would you choose instead? - What would you do different?


  👤 austin-cheney Accepted Answer ✓
Yes. It’s simple, fast, and durable. I just wrote a proxy from scratch that runs HTTP over WebSockets with both TCP and TLS. The code is super tiny without dependencies. Support for vanity domains in my new proxy just consists of mapping the domain name to a port number in a config file.

That replaces Apache with the insanity of mod libraries and virtual host configurations. Redirecting WebSocket traffic using virtual hosts was a real pain to figure out.


👤 physicsguy
I didn't like working with it much personally (using Express). Typescript always feels very clunky to me, and if doing it in Javascript you lose type safety obviously. The package ecosystem I didn't like very much, too many changes to stay up to date with things for limited benefit.

Currently work in Go and Flask depending on what the service is, much easier to work with than Node.

The most productive I've ever felt was with Django + REST Framework, mainly because so much is built in and it has a good package ecosystem around it. If working with a database the migration support is amazing. I've heard Rails is similar but never tried it personally.

But with all this, I usually say to people to stick to what they know or what the hiring market can support. There's no point learning for e.g. Elixir if you can't find devs to work on it without upskilling them.