After cloning this repository:
nvm use
to switch to the correct node versionpnpm install
to install the project dependenciespnpm dev
to start the server in development modepnpm routes
to see the list of routes availablepnpm test
to run tests and see coverage reportpnpm build
to build the project for productionpnpm start
to start the server in production modegit checkout -b feature/23-add-login-route
(for a ticket with id 23). If it's a bug, do something like git checkout bug/23-fix-login-route
instead./tests
. (See the Test Cycle section below for more details)pnmp test
.git add .
git commit -m "I added the new login route"
git push origin feature/23-add-login-route
test/helper.ts
creates a test configuration which is passed to an app instance (bootstrapped with @fastify-cli/helper) which is then handed to a test suite.Note that this repo contains fastify-cli, which is a CLI for fastify. It is installed when you run pnpm install
.
You can feed it a fastify plugin file and it will run the server for you..
The majority of commands in package.json
are therefore fastify-cli commands that are simply fed the api app in src/app.ts
.
The actual server is in the src/server.ts
file. This is what will run the api app when fastify-cli isn't around to run it.
To learn Fastify, check out the Fastify documentation.