Project Stock Price Checker
- SET NODE_ENV to
test
without quotes and set DB to your mongo connection string - Complete the project in
routes/api.js
or by creating a handler/controller - You will add any security features to
server.js
- You will create all of the functional tests in
tests/2_functional-tests.js
Learning Notes
- Example of how to get user ip via header
- Example of .then() statement to call function and get data within returned object
- Example of MongoClient.connect in await/async style
- Example of function calling MongoClient.connect in await/async so variable can be returned in main function
- Example of using node-fetch npm
- Example of getting data from body of fetch() via await/async
- Example of using findOne() in MongoDB to retrieve returned object
- Example of using findOneAndUpdate() in MongoDB with upsert and returnNewDocument
- Example of naming db and collection separately in MongoDB
- Example of Chai.js tests with added header to detect IP using set()
- Example of using regex in Chai.js
- Example of using assert .property(), .typeOf(), isAbove(), .match(), in Chai