"Why should I prefer Fastify to Expressjs?"
A lot of people ask me this question over and over again, so I would like to share why I pre...
For further actions, you may consider blocking this person and/or reporting abuse
I think the article provides a very good case for using Fastify over Express.js, lot of good points, If someone wants to get a bit more technical details and code example on the subject I would suggest reading this - Express.js vs Fastify - In-Depth Comparison of Node.js Frameworks
Nice article tho!
Hey ! Thanks a lot for your feedback.
I personally would love to try Fastify and play with it. Honestly, I could even use it for my next production project (I am talking about pure Falsify, not Nest + Falsify).
Nevertheless, I regret the lack of serious starter or boilerplate for production-ready fastify project, as you can find on Nest, Koa, Express, ...
I agree on using pure Fastify: this avoids a lot of useless headache for what I saw on SO - a lot of unanswered questions.
Spoiler: we are working on it!
Great news!
I started a prototype project to build my code template for production-ready fastify project. It's available here (I will be honored to have some feedback) :-)
@eomm It's possible to follow the development of your project?
Not yet, but it will be possible in the near future 👍
All of your doc links are broken.
When you say "So, adding a middleware in expressjs will affect all the requests, even if not necessary.", you can add middleware just to specific routes: see "Router-level middleware" in the docs: expressjs.com/en/guide/using-middl...
Can you expand on the monkey patching part with specific examples?
Thanks, links fixed.
It is in the source code:
github.com/expressjs/express/blob/...
Here a better video: youtube.com/watch?v=imw7bIjODr0
Your first doc link is still broken: link
You should add that express source code link to the article.
And how is Fastify builidng on top of
http.ClientRequest
not monkey patching? Express builds on top ofhttp.IncomingMessage
, how is this monkey patching? Isn't building on top of something inherently monkey patching as changing that underlying thing will change everything on top of it?how long have you been working as a dev, & how much do you need to know to be able to build a framework like this
I'm contributing to Fastify since 2019 and I think to build a framework like this one you need to know how Node.js works under the hook. There is a lot of prototype inheritance to implement the encapsulation system that is not trivial