- Install project dependencies
npm install
- Then start the application
npm run start
- Navigate to your browser to view the app on
http://localhost:8080
Optional: Did you miss something in our hotel API? Something that is really needed or you think is important to have before starting with the design or frontend? Please write down your thoughts in a simple list with short statements that we can discuss these point together later.
- Pagination: Since its possible for the API to return 500 hotels, pagination is important for better handling of response data on the front end
- Error documentationn: I think errors shouldn't be passed from the front end as query parameters, errors should come from the backend with a descriptive message so it can be handled properly on the front end.
Run the application test:
npm run test
To be able to show a list of flights where people can search for flights to their various hotels we would be needing the following:
GET http://fake-flight-api.com/api/flights
Query Parameter | Value |
---|---|
location | Required: Hotel Location |
- HTTP Status:
200: OK
JSON data
{
"status": "success",
"data": {
"departure": "Current Location",
"arrival": "Hotel Location",
"duration": "1:02:52",
"status": "Scheduled",
"marketingCarriers": [
{
"airlineCode": "VA",
"flightNumber": "6427",
"airline": "Virgin Australia",
"flightSchedule": [
{
"departingAt":"2018-11-19T07:20:00-0800",
"arrivingAt": "2018-11-19T07:20:00-0900",
}
],
},
{
"airlineCode": "VS",
"flightNumber": "5734",
"airline": "Virgin Atlantic Airways",
"flightSchedule": [
{
"departingAt":"2018-11-19T07:20:00-0800",
"arrivingAt": "2018-11-19T07:20:00-0900"
}
],
}
],
}
}
- HTTP Status:
400: Bad Request
JSON data
{
"status": "fail",
"data": {
"location": "Location is required"
}
}