My First REST API
In this tutorial you will learn how to expose a simple RESTfull API using Fastify, the emergent NodeJS Web Framework, in a ForrestJS App.
Install the Dependencies
In this toutorial we will use the following ForrestJS libraries:
npm add @forrestjs/core
npm add @forrestjs/service-fastify
npm add @forrestjs/service-fastify-healthz
We will also connect to a PostgreSQL database using the library pg:
npm add pg
npm add envalid
Also, we use Nodemon as development runner:
npm add -D nodemon
Step By Step
- Fastify App Scaffold
- Create a Simple Home Page
- The Users Feature
- Add a New User
- Connect to Postgres as a Service
- Integrate Services and Features
- Schema and Data Seeding
- Integrate Services and Services
- Evolve Your Schema
[[TO BE CONTINUED]]