Skip to content

contractormario/task1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Policy API Service

A simple RESTful API for managing insurance policies.

🕒 Time Spent: Approx. 2 hours 45 minutes across 3 short sessions
📅 Author: Mariusz Przybylski – [email protected]


📦 Prerequisites

  • Node.js v22.16.0 or higher
  • npm v10.9.2 or higher

🚀 Getting Started

Install dependencies

npm install

Run in development mode

npm run dev

Run in production mode

npm run build
npm run serve

✅ Running Tests

Tests are written using Jest and Supertest, covering all API endpoints.

npm run test

🔓 Public Routes

These routes are accessible without authentication:

GET /policies/:id
GET /policies?customerName=<name>

🔐 Protected Routes

These routes require API key authentication:

POST   /policies
PUT    /policies/:id
DELETE /policies/:id

Authentication Header

To access protected routes, include the following header:

x-api-key: my-static-api-key

📫 Postman Collection

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.

👤 Author

Mariusz Przybylski
[email protected]
June 2025

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published