Reputation: 3128
So I got reactJs as frontend and Laravel as backend.In local laravel is running on a t.test domain and reactJs is running on localhost:3000 but I want to deploy them now on the same domain on a sharing host.So how can I set this up?Putting laravel in the react or putting reactJs in public folder of laravel will that work?
Upvotes: 0
Views: 503
Reputation: 2093
Since reactJS is frontend and Laravel is Backend, you simply have to put react in the front line. 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. example backendservice.mydomain.com
.
then configure your url calls from react to the laravel backend.
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)
Here is a reference you could use. 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.
Upvotes: 1