This documentation provides details about the routes and endpoints exposed by the index.js
file located in the route/v1
directory.
Endpoint: POST /city
Creates a new city.
Endpoint: POST /cities
Creates multiple cities in a single request.
Endpoint: DELETE /city/:id
Deletes a city by its ID.
Endpoint: GET /city/:id
Retrieves a city's information by its ID.
Endpoint: GET /cityAirports/:name
Retrieves the airports associated with a city by its name.
Endpoint: PATCH /city/:id
Updates a city's information by its ID.
Endpoint: GET /city
Retrieves a list of all cities.
Endpoint: POST /flights
Creates a new flight.
Request Headers:
Content-Type: application/json
Request Body:
{
"origin": "string",
"destination": "string",
"departureTime": "string (ISO8601 format)",
"arrivalTime": "string (ISO8601 format)"
}
Endpoint: GET /flights
Retrieves a list of all flights.
Endpoint: GET /flights/:flightId
Retrieves a flight's information by its ID.
Endpoint: PATCH /flights/:flightId
Updates a flight's information by its ID.
Endpoint: POST /airports
Creates a new airport.
Request Headers:
Content-Type: application/json
Request Body:
{
"name": "string",
"city": "string",
"code": "string"
}
Please note that this documentation assumes the use of a RESTful API convention.
The routes and endpoints are based on the code provided in the index.js
file.
Make sure to replace placeholders like :id
and :flightId
with actual values when making requests.
Additionally, ensure that you have implemented the required controller functions and middlewares as indicated in the code.