This service provides all the available flights data.
You will need to below dependencies for running this application:
To install all dependencies run the following command:
npm install
You would need to create a .env file for the application to run. You can directly copy the values from .env.example to a new .env file.
You would need to replace the CREDENTIALS in the env file for both the suppliers. Sorry for the tedious task.
Finally you can start the application server:
npm run start
This would be running based on docker-compose. So please install the docker-compose before running this. This might take some time, since it would build the relevant dockers and start the application.
You can also start the application without the Docker, then please use command:
npm run dev
This application is based on ExpressJS.
For using the Service, please use the Postman request at
or use the exported Postman collection
or you can use the below-given curl request:
curl --location --request GET 'http://localhost:8000/api/flights' \
--header 'Authorization: Bearer 8xjM8PF9XC7KVUQ'
Currently the "Authorization" Token has been set in .env.example to 8xjM8PF9XC7KVUQ. So you would need to pass this as a header:
{"Authorization": "Bearer 8xjM8PF9XC7KVUQ"}
You can run the tests with command:
npm run test
You can also see the test coverage using:
npm run test:coverage
I have tried to write tests to cover the Logical parts.
You can run the linters with command:
npm run lint
Please find the choices and rationales here