DEV Community

Meat Boy
Meat Boy

Posted on

Whats your opinion on NestJS over Express?

Hi, for the past few years I have been using in my commercial and side projects Express.js as the main framework for the backend. However, I found NestJS to be more complete and ready to work on a project out-of-the-box without picking up orms, template engines and so on. With express it's not that much work but requires to keep maintainance on each dependency individually rather than a single NestJS version.

What's your opinion on NestJS? Did you try this and return to Express? What's your thoughts?

Top comments (5)

Collapse
 
insuusvenerati profile image
Sean

I use NestJS for literally any size API. Never seen any downsides to doing it like that over using express by itself.
However I don’t create APIs often since serverless functions and server side rendering is so prolific anyways.

Collapse
 
meatboy profile image
Meat Boy

Oh, here you mention really interesting thing. How easy or difficult was to switch to serverless from regular on-server api development?

Collapse
 
insuusvenerati profile image
Sean

As far as NestJS goes, it's very easy to use it for serverless since they have Standalone applications. docs.nestjs.com/faq/serverless
docs.nestjs.com/standalone-applica...

As far as switching goes, most of the time I did it in the framework itself. NextJS offers the ability to create API routes that run as serverless functions but only if you deploy the app on the Vercel platform. Gatsby does the same thing now. You can incrementally migrate to serverless pretty easily depending on the complexity of your API and the size of your team. For me, it was pretty easy since my apps are simple and I have a lot of DevOps experience.

Collapse
 
justaguyfrombr profile image
Misael Braga de Bitencourt

I use express for small APIs and Nest for the complex and big ones.

Collapse
 
gktim profile image
gkTim

Simply a very good backend framework. A lot of ready to use modules and really flexible. Good documentation.

And can use fastify which can handle more traffic than express :)