Typescript based REST API lite boilerplate using Fastify framework.
- Autoload fastify plugins with @fastify/autoload
- Security headers with @fastify/helmet
- CORS with @fastify/cors
- JSON Schema builder with TypeBox
- Enhanced support for TypeBox with @fastify/type-provider-typebox
- Swagger with @fastify/swagger
- Swagger UI with @fastify/swagger-ui
- The project uses biome to lint and format the codebase.
Install Node dependencies:
pnpm install
Running development server is pretty straightforward. It uses tsx, the easiest way to run Typescript in Node.js. Just run the following command in watch mode:
pnpm dev
To generate a production build, the project uses tsup. Build server with command:
pnpm build
To run tests, the project uses borp that is a typescript-aware test runner for Node.js built-in testing library. It also supports c8
coverage. Borp is very usefull if you want avoid struggling with loaders and false positives uncovered code.
pnpm test