簡體   English   中英

Heroku。 誰可以在php + reactJS上運行項目?

[英]Heroku. Who can I run the project on php + reactJS?

我需要一些在Heroku上運行Laravel / ReactJS應用程序的幫助。

據我了解,我需要將vendor/bin/heroku-php-nginxProcfile 我已經做到了,但是如何運行ReactJS部分呢? 我嘗試了以下命令:

web: vendor/bin/heroku-php-nginx public/ && npm run build

但在日志中,我看到:

2018-05-28T12:51:03.242771+00:00 heroku[router]: at=info method=GET path="/" host=still-sands-40110.herokuapp.com request_id=4b1448e5-76cc-4d4b-94b1-64d67f88b553 fwd="81.25.234.90" dyno=web.1 connect=0ms service=12ms status=200 bytes=1439 protocol=https
2018-05-28T12:51:03.478220+00:00 heroku[router]: at=info method=GET path="/js/app.js" host=still-sands-40110.herokuapp.com request_id=81eafe08-c586-4326-9ff4-432f18522f03 fwd="81.25.234.90" dyno=web.1 connect=0ms service=1ms status=404 bytes=707 protocol=https
2018-05-28T12:51:03.479057+00:00 heroku[router]: at=info method=GET path="/css/app.css" host=still-sands-40110.herokuapp.com request_id=c4c5a94b-a93b-45fb-809f-879f1293531f fwd="81.25.234.90" dyno=web.1 connect=1ms service=1ms status=304 bytes=170 protocol=https
/js/app.js - 404

可能是什么問題呢?

就我而言,解決方案是

程序文件:

網站:vendor / bin / heroku-php-apache2 public / && npm start

package.js:

“ start”:“節點public / js / app.js”

如果需要使用nginx,則可以配置自己的配置網站來配置路由:vendor / bin / heroku-php-nginx -C nginx_app.conf public /

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM