- GitHub To Heroku
- Node.js To Heroku
1. HOW TO DEPLOY AN APP TO HEROKU FROM GITHUB
Follow the steps
- Open heroku
- Create new app
- "test" (use required name)
- Connect to github
- Authorized(for first time)
- Heroku and git
- Search repo
- Connect
- Enable automatic deploy
- Deploy branch
App successfully deployed
You will get url
Like "test.herokuapp.com"
You will get url
Like "test.herokuapp.com"
1. HOW TO DEPLOY AN NODE.JS APP TO HEROKU FROM GITHUB
Create a new app in heroku where you want to deploy code
Open gitbase in project location
Or Open New Terminal in VS Code
Commands:
> heroku Login
> touch Procfile
(If command is not working in terminal, run command in gitbase in project location)
One file is created named as Procfile
Write following code in Procfile
web: node index.js
If index.js is in src folder give following code
web: node ./src/index.js
> git init
You can copy following code from heroku
> heroku git: remote -a <app>
> git add .
> git commit -m "put your msg here"
> git push heroku master
App successfully deployed
You will get url for your app.
Now for any changes You need only to follow three commands:
> git add .
> git commit -m "put your msg here"
> git push heroku master
You will be able to update code.
-- Thanks --
No comments:
Post a Comment