Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

I wrote a lot of TypeScript just using Express, and it pretty much always ended up looking kind of like this.

Today, though, I think this is reinventing the wheel for little benefit. I've moved my own projects to NestJS (https://nestjs.com/) and have found myself paying a lot more attention to logic and application behavior rather than structuring code around a too-thin web server.

NestJS uses Express or Fastify under the hood--because both are great web servers!--but serves to make life a lot more pleasant when using them. The way it strongly encourages the decoupling of application logic (services) and the serving of data to clients (controllers) is a good one and, to me, does a much better job of creating an "enterprise NodeJS and TypeScript" environment than rolling one's own.



I've been hearing a lot about NestJS recently. I've yet to try it out on a Greenfield project.

Yeah, I'm totally with you on that. Frameworks have the structure we all need but seem to neglect:) Although there is a lot of merit in learning by doing (hence the purpose of the article and my website overall).

Lots of brownfield vanilla Express.js Node APIs can be improved using this pattern.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: