A boilerplate to quickly start building REST APIs in NodeJS without writing (too much) boilerplate code. HTTP Routes are auto-generated based on API definition (written in OpenAPI Specification).
- OpenAPI Specification v3
- Fastify
- fastify-openapi-glue
- Mongoose
- Mocha, NYC, Sinon and Chai for automated testing and related metrics
DB_URI
: MongoDB URI
api/oas.yml
is the source of truth (definition) of the REST API.src/app.js
contains the boilerplate code to connect MongoDB client and to registerfastify-openapi-glue
middleware with proper configuration.src/service.js
would contain implementations of all the operations defined in API definition (omitted in this boilerplate).src/tests
contains cases to automate API testing.index.js
contains the boilerplate code to start Fastify server at port8080
.