A task manager api built using: nodejs, express, jsonwebtoken, mongodb, mongoose etc.
Sendgrid -- api for sending emails to clients
nodejs
installednpm
installed
cd task-manager-api-node
npm install
When pushed your app to heroku repository,
you need to set environment varibales using
heroku config
More info here
heroku config:set JWT_SECRET=thisismyawesomesecret
MONGODB_URL=mongodb://address-to-your-mongo-db-cluster/task-manager-api # actually this one you can get for free from Mongodb Atlas
SENDGRID_API_KEY=SG.fKx9Rmi6TPCntDrycEqCpg.t5na8ORUddsfI2gsvGj1JCUPKOJ3BUsiw2R3sha9pX5i9UE
Get them one free with non payed subscription form this service accordingly: Sendgrid -- api for sending emails to clients
export PORT=3000 # if run on your local. on heroku this var is set already for you
export JWT_SECRET=thisismyawesomesecret
export MONGODB_URL=mongodb://127.0.0.1:27017/task-manager-api
export SENDGRID_API_KEY=SG.fKx9Rmi6TPCntDrycEqCpg.t5na8ORUddsfI2gsvGj1JCUPKOJ3BUsiw2R3sha9pX5i9UE
npm run
- Change port number on which you want server to run in
config/dev.env
inconfig
folder
Put your tokens for Sendgrid in
config/dev.env
dont have this file and dir? create one ^^ from the root of this project
PORT=3000
JWT_SECRET=thisismyawesomesecret
MONGODB_URL=mongodb://127.0.0.1:27017/task-manager-api
SENDGRID_API_KEY=SG.fKx9Rmi6TPCntDrycEqCpg.t5na8ORUddsfI2gsvGj1JCUPKOJ3BUsiw2R3sha9pX5i9UE
to start dev server:
- you need to have mongodb running on your local machine
npm run dev
Put your tokens for Sendgrid in
config/test.env
dont have this file and dir? create one ^^ from the root of this project in config
folder
PORT=3000
JWT_SECRET=thisismyawesomesecret
MONGODB_URL=mongodb://127.0.0.1:27017/task-manager-api
SENDGRID_API_KEY=SG.fKx9Rmi6TPCntDrycEqCpg.t5na8ORUddsfI2gsvGj1JCUPKOJ3BUsiw2R3sha9pX5i9UE
npm run test
First do same config as in section Run test then run in your terminal
npm run test-dev