/stackoverflow-salary-nodejs

starter code to expose the Stack Overflow surveys as a web API

Primary LanguageJavaScript

stackoverflow-salary-nodejs

starter code to expose the Stack Overflow surveys as a web API

Insert the .csv Survey file in a Mongo Database

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 

Install the dependencies

run

nmp install

Start the application

Nodemon is used to have live-reload

nodemon index.js

Use the application

e.g. with curl

curl get http://localhost:8080/api/salary/belgium

The response should be

[
    {
        "_id":"Belgium",
        "average":39908.81720430106
    }
]