0

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?

2
  • Normally you have your react stuff as SPA in your public folder. Commented Mar 13, 2020 at 13:39
  • The react stuff are on a folder public after build but laravel has it's own public folder too. Commented Mar 13, 2020 at 14:25

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

That's the best idea.Wonder why it didn't occur to me.Thank you so much.
The stress of work gets the best of all of us. Am glad to help!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.