Skip to content

Latest commit

 

History

History
61 lines (46 loc) · 1.43 KB

heroku 部署.md

File metadata and controls

61 lines (46 loc) · 1.43 KB

heroku

fairyilys@gmail.com@123456

已部署 node 项目: my blog

Install the Heroku CLI
Download and install the Heroku CLI.

If you haven't already, log in to your Heroku account and follow the prompts to create a new SSH public key.

$ heroku login

Create a new Git repository
Initialize a git repository in a new or existing directory

$ cd my-project/
$ git init
$ heroku git:remote -a zhimeng

Deploy your application
Commit your code to the repository and deploy it to Heroku using Git.

$ git add .
$ git commit -am "make it better"
$ git push heroku master

Existing Git repository
For existing repositories, simply add the heroku remote

$ heroku git:remote -a zhimeng

The application is now deployed. Ensure that at least one instance of the app is running:

$ heroku ps:scale web=1

Now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

$ heroku open

git 项目部署

1. git clone git项目地址
2. cd 项目目录
3. heroku create, 这时候,heroku 会为我们随机取一个应用名字,并提供一个 git 仓库给我们。
4. git remote -v
5. git push heroku master
6. heroku open  打开项目,则 heroku 会自动打开浏览器带我们去到相应的网址