This repository contains the Flight and Search microservice, which provides APIs for managing cities, airports, and flights. This README.md file serves as documentation for this microservice, explaining the available routes and their corresponding functionalities.
- Route: POST /city
- Controller: CityController.create
- Description: Creates a new city.
- Route: DELETE /city/:id
- Controller: CityController.destroy
- Description: Deletes a city with the specified ID.
- Route: GET /city/:id
- Controller: CityController.get
- Description: Retrieves a city by its ID.
- Route: PATCH /city/:id
- Controller: CityController.update
- Description: Updates the information of a city with the specified ID.
- Route: GET /cities
- Controller: CityController.getAll
- Description: Retrieves a list of all cities.
- Route: POST /airport
- Controller: AirportController.create
- Description: Creates a new airport.
- Route: DELETE /airport/:id
- Controller: AirportController.destroy
- Description: Deletes an airport with the specified ID.
- Route: GET /airport/:id
- Controller: AirportController.get
- Description: Retrieves an airport by its ID.
- Route: GET /airport
- Controller: AirportController.getAll
- Description: Retrieves a list of all airports.
- Route: PATCH /airport/:id
- Controller: AirportController.update
- Description: Updates the information of an airport with the specified ID.
- Route: POST /flight
- Controller: FlightController.create
- Description: Creates a new flight.
- Route: GET /flight/:id
- Controller: FlightController.get
- Description: Retrieves flight information by its ID.
- Route: GET /flight
- Controller: FlightController.getAll
- Description: Retrieves a list of all flights.
- Route: PATCH /flight/:id
- Controller: FlightController.update
- Description: Updates flight information with the specified ID.
- Route: DELETE /flight/:id
- Controller: FlightController.destroy
- Description: Deletes a flight with the specified ID.
To use this microservice, you can make HTTP requests to the provided routes using the appropriate HTTP methods (e.g., POST, GET, PATCH, DELETE) and supply the required data in the request body or parameters. Make sure you have the necessary authorization and authentication mechanisms in place if required.
To run this microservice locally or in a production environment, follow these steps:
- Clone this repository to your local machine.
- Install the required dependencies using npm or yarn.
- Configure environment variable if you are running it locally.
PORT = 3000
- Start the microservice using the provided start script.
git clone https://github.com/arvindpndit/Flight-and-search-service.git
cd Flight-and-search-service
npm install
npm start