A sequel of the Incident Reporting API (incident_reporting_api). This uses Sequelize as the DB ORM instead of raw SQL. API to receive reported incidents from insurance clients and return all reported incidents. Its a
- clone this repo
- cd into the folder (incident_reporting_api)
- run the commands below
npm install
- run application with node or nodemon
node index.js
or
nodemon index.js
GET /api/get_incidents
"resp_code": "001",
"resp_desc": "Incident records found",
"details": [ json_object]
}
GET /api/get_client_incident/:client_id
"resp_code": "001",
"resp_desc": "Incident records found",
"details": [ json_object]
}
POST /api/req_submit_report
Parameter | Type | Description |
---|---|---|
client_id |
integer |
Required. Id of the client |
incident_desc |
string |
Required. Description of incident |
city |
string |
Required. City of incident |
country |
string |
Required. Country of incident |
"resp_code": "000",
"resp_desc": "Incident report has been processed and saved successfully."
}
To run this project, you will need to add the following environment variables to your .env file
DATABASE_URL
PORT
WEATHER_API_TOKEN
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.