To debug node application we should to
- Add debugger keyword anywhere in code
- Then in terminal fired following command
$ node --inspect-brk filename.js
or
$ node --inspect filename.js
Download and install heroku setup from the link below
https://devcenter.heroku.com/articles/heroku-cli#download-and-install
After installing :-
To see the version installed
$ heroku -v
To login
$ heroku login
Please Scroll down to SSH topic and create your ssh command to your machine and continue this step
To use ssh public key to heroku
$ heroku keys:add
$ y
To create heroku app your project must be uploaded to Github first , if so then Go the root of the Project and fire following command :-
$ git remote
// Origin
//heroku this remote must be shown after git remote command
$ heroku create <filename>
$ heroku create nabin-weather-app
The file name should be unique and identifying so that all the heroku application should be known
$ heroku create nabin-weather-app
The regular way to set up environment variables is
$ heroku config:set key=value
To see the configuration
$ heroku config
//this will show all the config of .env
To remove the configuration
$ heroku config:unset key
For complete Example:-
//To add
$ heroku config:set jwt=demoStringsExmple
//To view
$ heroku config
//To remove or unset
$ heroku config:unset jwt
And push to heroku as same as pushing to Github
$ git push heroku master
add a different ip address
0.0.0.0/0
save db id and password
This is only for Windows machine
$ ls -a -l ~/.ssh
- ls list out all of the files in the directory
- -a is used to show all the files including hidden file and folder
- -l list everything top to button (format easire us to list )
$ ssh-keygen -t rsa -b 4096 -C "your email address"
- ssh-keygen This allows us to generate the pair of ssh key
- -t this stand for type , to use protocal
- rsa rsa is a protocal ,
- -b for bits , we have provide 4096 bits for this demo
- -C this C is a capital C , which is used as a comment
$ eval $(ssh-agent -s)
This wil give the agent pid id
$ ssh-add ~/.ssh/id_rsa
- In Github Go to Setting > Personal Setting > SSH and GpG key then
- Give ssh key Title (any) and then go to bash terminal and hit
$ cat ~/.ssh/id_rsa.pub
- Then copy all the (long) key from the terminal and paste them key section
***** And you done **********
$ ssh -T git@github.com
To use ssh public key to heroku
$ heroku keys:add
$ y