Fastify — the name is the motto. At least that is what the framework for Node.js wants to stand for — Speed.

After we had already noticed in the last article that bare Node.js is clearly inferior to Express, I asked myself the question, what else can be used to develop fast web servers without using the node’s own HTTP module.

Fastify came to my mind — so I wrote the same API three times again — in pure Node.js, in Express.js, and in Fastify. And now let me show you how Fastify performs against the competition.

Let’s start by writing the APIs.

Let’s install Fastify first

As usual, we do this with NPM: npm install fastify

Now we can write the Fastify server. There are two ways to develop a web application in this framework. First, there is the possibility to build a schema that is used to do input and output validation. On the official website of Fastify you can see this quite well:

Image for post

#web-development #expressjs #fastify #javascript #nodejs #node

I Built the Same API With Fastify, Express & Bare Node.js. Here are the differences.
3.65 GEEK