This time I will bring you how to deploy Node.JS to Heroku and what are the precautions for deploying Node.JS to Heroku. The following is a practical case. , let’s take a look.
Heroku is a cloud platform that provides rapid deployment services. It supports Node, Ruby, Java, PHP, Python, and Go multiple languages. I tried it today and it’s really cool. Here is a brief introduction.
First of all, you still need to register an account: https://signup.heroku.com/login
I don’t know why, the 163 email address cannot be passed here, but qq can. Then select the language Node.js.
After successful registration, activate your email and fill in your password.
After successful login, enter the panel and create an application
The name is optional
After the creation is successful, enter the deployment page of the app. Three deployment methods are provided, Heroku Git, Github and Dropbox.
The default is HeroGit method, here we choose Github method. After github authorization, you can query your own project below . Here select getting-mean
## If there is no git project for node, fork one to play with. https://github.com/stoneniqiu/getting-MEAN/branches/stale 3. ReleaseAfter the connection is successful, you can choose automatic deployment and the branch to be deployed. # Select master here. After successful deployment, the following interface will appear. Click View to access. #The page opens as follows. The domain name is also very regular. Isn’t it great? If you want to delete the application, go to the Settings column. The free space is 300M. Summary: This article is just a brief introduction. Not counting registration, you can complete the deployment of a node project in three steps. Compared with using virtual machines or cloud methods, Heroku combines code hosting and deployment. , and different branches can be deployed, which is very convenient. FTP code transfer and remote deployment on cloud computing are cumbersome. Heroku's approach is worth trying. I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website! Recommended reading:Nodejs form verification and image upload
Nodejs uses Angular to create a single-page application
The above is the detailed content of How to deploy Node.JS to Heroku. For more information, please follow other related articles on the PHP Chinese website!