starter code to expose the Stack Overflow surveys as a web API
a bash script is provided (init_db.sh). This file runs:
mongoimport --host=127.0.0.1 -d stackoverflowsurveydatabase -c stackoverflowsurvey --type csv --file assets/survey_results_public.csv --headerline
run
nmp install
Nodemon is used to have live-reload
nodemon index.js
e.g. with curl
curl get http://localhost:8080/api/salary/belgium
The response should be
[
{
"_id":"Belgium",
"average":39908.81720430106
}
]