A very simple API example using TypeScript, Fastify, Postgres, Mongo, Repository Pattern, and Dependency Injection for our technical blog post.
Follow the next instructions to run the api:
- Install all dependencies:
npm ci
- Spawn the local infrastructure:
npm run infra:up
- Start the api:
npm start
You can send requests to the API using HTTPie
http POST http://localhost:3000/products <<< '{ "name": "[PRODUCT_NAME]" }'
http GET http://localhost:3000/products/[PRODUCT_ID]
npm run db:migrate