- router object .use() the authRouter
- Changed the get method for path signin to a post
- added mongoDbUri
- added PORT <= Did break without
- Required in node packages 'bcrypt' and 'jsonwebtoken'
- users.methods.comparePassword added terinary to the promise
- in _appBasic added parameter
- let auth = {username,password} instead of let auth = [username,password]
- added auth from middleware.js
- used the middleware.js middleware function on each route
PORT=3000
- Port NumberMONGODB_URI=mongodb://localhost:27017/lab11
- URL to the running mongo instance/db
npm i
- populate the .env with port and mongodb_uri
nodemon
- new terminal within repo
echo '{"username":"Spence","password":"badass"}' | http post :3000/signup
http post :3000/signin -a Spence:badass
http :3000/books -a Spence:badass
http :3000/books/1 -a Spence:badass
npm run test
npm run lint