An Express.js application for serving the case-study records. Live at heroku!
startDate
Date for filtering the results from. formatYYYY-MM-DD
startDate
Date for filtering the results to. formatYYYY-MM-DD
minCount
Min value for the counts sum.maxCount
Max value for the counts sum.
curl --location --request POST 'https://ta6ish-case-study.herokuapp.com/api/case-study' \--header 'Content-Type: application/json' \--data-raw '{
"startDate": "2015-05-10",
"endDate": "2015-05-18",
"minCount": 20,
"maxCount": 80
}'
code
0 means successmsg
Message explaining the operation executionrecords
Filtered results
{"code":0,"msg":"success","records":[{"key":"PFHJeccA","createdAt":"2015-05-17T15:32:16.799Z","totalCount":36}]}
To run this app locally you will need:
- Install dependencies
npm install -D
- Rename
.env.example
to.env
and provide values. - Start in development mode
npm run dev
curl --location --request POST 'http://localhost:3000/api/case-study' \--header 'Content-Type: application/json' \--data-raw '{
"startDate": "2015-05-10",
"endDate": "2015-05-18",
"minCount": 20,
"maxCount": 80
}'
npm test
docker build -t nodeapp .
docker container run -p 3000:3000 -d nodeapp