How to use heroku on a node react web app

余生颓废 提交于 2019-12-13 03:23:55

问题


I tried to follow the official tuto but it doesn't works.

My project looks this: my-app api package.json app package.json


回答1:


If heroku is not detecting your buildpack, follow this answer.

If in other hand, your app is not running even if you defined your buildpack it might be because your proc file is not properly defined.

In your app, a file called Procfile must be created (with no extension) in the base of your directory. This file will tell heroku what to run.

A very simple example is this one. If for example your app has a server.js file, the procfile can be defined like this:

web: node server.js

If you have this file in your directory and you push to heroku, heroku will understand that it is a node app and will serve your app correctly.



来源:https://stackoverflow.com/questions/52085338/how-to-use-heroku-on-a-node-react-web-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!