A sample API server for use as an optimization subject.
- Clone this repository
- Install dependencies
npm install
- Start the server
npm start
- Go to http://localhost:3000/ to confirm the server is running
The API consists of a single endpoint which receives data when a patient uses their inhaler.
- method: POST
- endpoint: /api/usages
- data: JSON usage object
- result: JSON object containing the usageId, HTTP Status 201, 200, 500
Data
{
"patientId":100,
"timestamp":"Tue Nov 01 2016 09:11:51 GMT-0500 (CDT)",
"medication":"Albuterol",
}
Request
curl -X POST -H "Content-Type: application/json" --data '{"patientId":"100","timestamp":"Tue Nov 01 2016 09:11:51 GMT-0500 (CDT)","medication":"Albuterol"}' http://localhost:3000/api/usages
Response
{
"id":22954
}