This document references the APIs available across the Flight Service, Booking Service, and API Gateway.
Base URL : http://localhost:<FLIGHT_SERVICE_PORT>/api/v1
Method
Endpoint
Description
POST
/airplane/
Create a new airplane. Requires validation.
GET
/airplane/
Get all airplanes.
GET
/airplane/:id
Get a specific airplane by ID.
PUT
/airplane/
Update an airplane.
DELETE
/airplane/:id
Delete an airplane by ID.
Method
Endpoint
Description
POST
/city/
Create a new city.
GET
/city/
Get all cities.
GET
/city/:id
Get a specific city by ID.
PUT
/city/:id
Update a city by ID.
DELETE
/city/:id
Delete a city by ID.
Method
Endpoint
Description
POST
/airport/
Create a new airport.
GET
/airport/
Get airport details.
GET
/airport/:id
Get all airports (Note: Naming convention in code suggests :id but handler is getAll).
PUT
/airport/
Update airport details.
DELETE
/airport/:id
Delete an airport by ID.
Method
Endpoint
Description
POST
/flight/
Create a new flight.
GET
/flight/
Get all flights.
GET
/flight/:id
Get a specific flight by ID.
PATCH
/flight/:id/seats
Update flight seats.
Method
Endpoint
Description
GET
/ping/
Health check route.
Base URL : http://localhost:<BOOKING_SERVICE_PORT>/api/v1
Method
Endpoint
Description
POST
/booking/
Create a new booking.
POST
/booking/payments
Process a payment.
Method
Endpoint
Description
GET
/ping/
Ping check (with request body validation).
GET
/ping/health
Simple health check.
3. API Gateway - Local APIs
Base URL : http://localhost:<GATEWAY_PORT>/api/v1
These APIs are handled directly by the API Gateway service (Authentication & Authorization).
Method
Endpoint
Description
GET
/
Ping check (Protected).
POST
/signup
User registration.
POST
/signin
User login.
POST
/role
Add role to user (Admin only).
4. API Gateway - Proxy APIs
The API Gateway acts as a reverse proxy for the microservices. You can access the backend services through the gateway using the following mappings.
Base URL : http://localhost:<GATEWAY_PORT>
Proxied Flight Service APIs
Pattern : /flightsService/* -> Forwarded to Flight Service
Method
Gateway Endpoint
Target Service Endpoint
POST
/flightsService/api/v1/airplane/
POST /api/v1/airplane/
GET
/flightsService/api/v1/airplane/
GET /api/v1/airplane/
GET
/flightsService/api/v1/airplane/:id
GET /api/v1/airplane/:id
PUT
/flightsService/api/v1/airplane/
PUT /api/v1/airplane/
DELETE
/flightsService/api/v1/airplane/:id
DELETE /api/v1/airplane/:id
POST
/flightsService/api/v1/city/
POST /api/v1/city/
GET
/flightsService/api/v1/city/
GET /api/v1/city/
GET
/flightsService/api/v1/city/:id
GET /api/v1/city/:id
PUT
/flightsService/api/v1/city/:id
PUT /api/v1/city/:id
DELETE
/flightsService/api/v1/city/:id
DELETE /api/v1/city/:id
POST
/flightsService/api/v1/airport/
POST /api/v1/airport/
GET
/flightsService/api/v1/airport/
GET /api/v1/airport/
GET
/flightsService/api/v1/airport/:id
GET /api/v1/airport/:id
PUT
/flightsService/api/v1/airport/
PUT /api/v1/airport/
DELETE
/flightsService/api/v1/airport/:id
DELETE /api/v1/airport/:id
POST
/flightsService/api/v1/flight/
POST /api/v1/flight/
GET
/flightsService/api/v1/flight/
GET /api/v1/flight/
GET
/flightsService/api/v1/flight/:id
GET /api/v1/flight/:id
PATCH
/flightsService/api/v1/flight/:id/seats
PATCH /api/v1/flight/:id/seats
Proxied Booking Service APIs
Pattern : /bookingService/* -> Forwarded to Booking Service
Method
Gateway Endpoint
Target Service Endpoint
POST
/bookingService/api/v1/booking/
POST /api/v1/booking/
POST
/bookingService/api/v1/booking/payments
POST /api/v1/booking/payments
GET
/bookingService/api/v1/ping/
GET /api/v1/ping/
GET
/bookingService/api/v1/ping/health
GET /api/v1/ping/health