A simple RESTful API for managing insurance policies.
🕒 Time Spent: Approx. 2 hours 45 minutes across 3 short sessions
📅 Author: Mariusz Przybylski – [email protected]
- Node.js
v22.16.0
or higher - npm
v10.9.2
or higher
npm install
npm run dev
npm run build
npm run serve
Tests are written using Jest and Supertest, covering all API endpoints.
npm run test
These routes are accessible without authentication:
GET /policies/:id
GET /policies?customerName=<name>
These routes require API key authentication:
POST /policies
PUT /policies/:id
DELETE /policies/:id
To access protected routes, include the following header:
x-api-key: my-static-api-key
A Postman collection is provided to make exploring the API easier:
mario.postman_collection.json
You can import it into Postman directly or use it with CLI tools like Newman.
Mariusz Przybylski
[email protected]
June 2025