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.0or higher - npm
v10.9.2or higher
npm installnpm run devnpm run build
npm run serveTests 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