Api that receives feedback from hotel guests
Install dependecies
npm i
And than start the API
npm start
App is starting on port 8080
Just run docker-compse and everything should be fine
docker-compose up
Docker app runs on port 49160
This will run lint, test and coverage
npm run test
For linting only
npm run lint
For coverage only
npm run coverage
If you are using postman you can simply import postman collection, just keep in mind postman is set up for http://localhost:8080 -> postman-collection
- [GET] - {service_url}/feedback - Returns all of the feedbacks. Basic authentication required (Username - Admin, passowrd - Admin). Also supports filtering using query strings take a look below for more info
Query string key | Type | Description | Example |
---|---|---|---|
authorName | String | Filter by author name | 'Test Testoff' |
fromDate | DateTime | Get all feedbacks starting from. API expects Date Time in UTC. | '2020-05-27T10:54:51Z' |
toDate | DateTime | Get all feedbacks no later than provided date. API expects Date Time in UTC. | '2020-05-28T10:54:51Z' |
- [POST] - {service_url}/submit - Submits feedback, expects
authorName
andbody
params passed in body JSON format. Take a look on input/output schema below.
Prop key | Type | Description | Example |
---|---|---|---|
authorName | String | Feedback's author name | 'Tom Jerry' |
body | String | Feedback itself | 'Awesome hotel' |
Prop key | Type | Description | Example |
---|---|---|---|
authorName | String | Feedback's author name | 'Tom Jerry' |
body | String | Feedback itself | 'Awesome hotel' |
dateCreated | DateTime | Date on which feedbacks has been submitted | '2020-05-28T10:54:51Z' |