npm i
- install all depedencies.env
- add the following environment variables:PORT
- assign a port numberMONGODB_URI
- URL to the running mongo instance/dbSECRET
- secret to sign/verify JWT token
- install
HTTPie
to make HTTP requests in your CLI
nodemon
- get the sever up an running on thePORT
you specify in your.env
- Endpoint:
/signup
- (usingHTTPie
in the CLI)echo '{"username":"<yourusername>", "password":"<yourpassword>", "role":"role"}' | http :<yourPORT>/signup
- a token should be returned
- Endpoint:
/signin
http post :<yourPORT>/signin "Authorization: Bearer <yourtoken>
- a new JWT token generated by the server should be returned
router.get('/public-stuff')
should be visible by anyonerouter.get('/hidden-stuff')
should require only a valid loginrouter.get('/something-to-read')
should require theread
capabilityrouter.post('/create-a-thing)
should require thecreate
capabilityrouter.put('/update)
should require theupdate
capabilityrouter.patch('/jp)
should require theupdate
capabilityrouter.delete('/bye-bye)
should require thedelete
capabilityrouter.get('/everything')
should require thesuperuser
capability
- How do you run tests?
npm run test
npm run lint