This is a recording of the free Get Started With Fastify workshop that I ran on May 18th, 2021.
The code for this workshop is on GitHub:
https://github.com/simonplend/workshop-get-started-with-fastify
The beginning of the workshop is missing from the video as I forgot to start recording until we were a few minutes in!
Here are my notes for those missing few minutes:
- In this workshop we’re going to be building a basic API with the Fastify framework. This will be the start of an API for a recipes app
- In the next hour we’re going to cover:
- Creating a Fastify server instance
- Adding an API route for creating new recipes
- Adding request validation to the new recipe API route
- Let’s take a look at our application’s
package.json
- Setting
type
tomodule
to tell Node.js that we’re using ECMAScript modules, usingimport
/export
syntax start:dev
npm run script, usingnodemon
for restarting the applicationstart
npm run script, will be run when we runnodemon
dependencies
anddevDependencies
- Show empty
server.js
- Start server with nodemon –
npm run start:dev
curl -v localhost:3000
– no HTTP server- We need to create a Fastify server instance which can listen for HTTP requests
…and the rest of the workshop is in the video!