Dominic TobiasFollowDec 23 · 2 min readReleased in 2016, Fastify isn’t a new project but it has been actively maintained and with 21.5k stars on GitHub, it has gathered quite
By Kate Angelou
Dec 23 · 2 min read
Released in 2016, Fastify isn’t a new project but it has been actively maintained and with 21.5k stars on GitHub, it has gathered quite the following. Based on its stats, it’s easy to see why:
Another nice feature is that it supports JSON Schema to validate input and output of HTTP handlers (more on that later).
First we will install fastify, middie, and some commonly used middleware:
yarn add fastify middie cors frameguard x-xss-protection
To give you an idea of using the optional JSON Schema, let’s validate and strongly type a querystring so that it must contain postcode:
Here you can see that we’re not only using TypeScript, but also additional JSON schema to validate and ensure that our API output is exactly what we want it to be.
On line 14, we see that our API looks almost identical to what we would typically expect to see from an Express API. This makes it easy for Express developers to quickly jump over to Fastify and stay productive. So it’s an easy replacement with a great performance boost!
Build Micro Frontends with components
Microfrontends are a great way to speed up and scale app development, with independent deployments, decoupled codebases, and autonomous teams.
Bit offers a great developer experience for building component-driven Micro frontends. Build components, collaborate, and compose applications that scale. Our GitHub has over 14.5k stars!
Give Bit a try ?
Building a React Component Library — The Right Way
Create an ultra-modular React component library: scalable, maintainable, and with a blazing-fast setup.
Microservices are Dead — Long Live Miniservices
Are you really using microservices for your application? Think again.
7 Tools for Faster Frontend Development in 2022
Tools you should know to build modern Frontend applications faster, and have more fun.