Instructions / notes for running and testing the backend server
Links
- https://nodejs.org/en/docs/guides/
- https://mongodb.github.io/node-mongodb-native/3.1/quick-start/quick-start/
- https://cloud.mongodb.com/v2/5b8727749701993a37d8c670#clusters/detail/Cluster0 (Our MongoDB cloud cluster)
Before running the server
npm install
Installing npm packages
npm install <package name>
To save the node package to package.json
npm install --save <package name>
To run the server locally, within backend/
node app.js
Now you can test GETs, POSTs, etc. with Postman
First run the server locally. Within Postman set the requrest url to
localhost:5000/api/...
Replace ... with whatever route you wish to access. If sending a POST, the contents sent are in the Body section. Tokens go in the header.
Make sure that when you are sending a POST request, in the Body section, choose x-www-form-urlencoded and enter the body keys and values there.