This API provides endpoints to retrieve flight information based on various parameters such as origin, destination, travel dates, number of passengers, and class preference (economy, business, or first class).
- from: Departure location.
- to: Destination location.
- oneWay: Boolean indicating if it's a one-way flight (
true
orfalse
). - departureDate: Date of departure (format: YYYY-MM-DD).
- returnDate: Date of return flight (required if
oneWay
isfalse
; format: YYYY-MM-DD). - passengers: Number of passengers.
- class: Travel class preference (e.g., economy, business, first).
curl -X GET 'http://localhost:5000/api/flights?from=New+York&to=Los+Angeles&oneWay=false&departureDate=2024-07-10&returnDate=2024-07-15&passengers=2&class=economy'
To set up and run the API locally, follow these steps :
- Clone the Repository
git clone https://github.com/your-username/flight-info-api.git
cd flight-info-api
- Install Dependencies
npm install
- Run the Server
npm start