Skip to content

simonplend/express-to-fastify-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

express-to-fastify-migration

Example applications demonstrating a migration from Express to Fastify.

Article

The code in this repository was written to accompany the article How to Migrate Your API From Express to Fastify.

Usage

Run the Express application (api-before):

npm install --prefix api-before

npm start --prefix api-before

Run the Fastify application (api-after):

npm install --prefix api-after

npm start --prefix api-after

Example requests

When you have either the Express or Fastify server running you can make requests to it in your terminal using cURL.

Create user

curl --verbose --request POST \
  --url http://localhost:3000/user \
  --header 'Content-Type: application/json' \
  --header 'Origin: http://example-origin.com' \
  --data '{
	"first_name": "Bobinsky",
	"last_name": "Oso",
	"age": 27
}'

Get user

curl --verbose --request GET \
  --url http://localhost:3000/user/3d395cb4-531c-4989-b8ed-9cc75198187e \
  --header 'Origin: http://example-origin.com'

License

MIT

About

Example applications demonstrating a migration from Express to Fastify.

Topics

Resources

License

Stars

Watchers

Forks

Contributors