简体   繁体   English

React js + laravel 部署

[英]React js + laravel deploy

所以我把 reactJs 作为前端,Laravel 作为后端。在本地 laravel 运行在 t.test 域上,reactJs 运行在 localhost:3000 上,但我现在想将它们部署在共享主机上的同一个域上。那么我该怎么办设置这个吗?将 laravel 放在 react 中或将 reactJs 放在 laravel 的公共文件夹中会起作用吗?

Since reactJS is frontend and Laravel is Backend, you simply have to put react in the front line.由于 reactJS 是前端而 Laravel 是后端,因此您只需要将 react 放在最前面。 so in an example, if you have mydomain.com react can run there directly and then you can let Laravel run on a seperate location.所以在一个例子中,如果你有mydomain.com react 可以直接在那里运行,然后你可以让 Laravel 在一个单独的位置运行。 example backendservice.mydomain.com .例如backendservice.mydomain.com

then configure your url calls from react to the laravel backend.然后配置你的 url 调用从 react 到 laravel 后端。

That is it.这就对了。 you do not need to put them all together.你不需要把它们放在一起。 I personally advise you to kep them seperate.我个人建议您将它们分开。

That way, versioning in the future could have a version 1.0 backend and version 2.5 frontend (basically, it becomes simple)这样,未来的版本控制可以有 1.0 版后端和 2.5 版前端(基本上,它变得简单)

Here is a reference you could use.这是您可以使用的参考。 https://developer.okta.com/blog/2018/12/06/crud-app-laravel-react https://developer.okta.com/blog/2018/12/06/crud-app-laravel-react

I hope I was clear enough.我希望我说得够清楚了。 if not, am willing to clarify further.如果没有,我愿意进一步澄清。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM