gpt4 book ai didi

javascript - 部署 Laravel(后端)和 React(前端)HEROKU

转载 作者:行者123 更新时间:2023-12-04 23:39:57 25 4
gpt4 key购买 nike

我有 laravel 应用程序(rest api)和 react/js 应用程序(客户端)。我想将它们部署在heroku上。将它们放入一个 git repo 并部署是否有可能实现这一目标?我尝试使用安装后脚本,但它不起作用。在此处输入代码

EDIT. Added nodeJS buildpack (node installed on server) but it seems that Laravel covers react pages with Sorry, the page you are looking for could not be found.

最佳答案

只需将此代码输入您的web.php :

Route::get('{reactRoutes}', function () {
return view('welcome');})->where('reactRoutes', '^((?!api).)*$');

关于javascript - 部署 Laravel(后端)和 React(前端)HEROKU,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53602101/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com