Reputation: 1296
Ok guys i was thinking about this question and didnt find anything related or that could clarify my mind about this. Its not an issue that im facing right now, its more curiosity and maybe it could help someone someday.
Whats the best way or best practice to create a reactjs application? Integrated with rails? Or with a separated rails api and separated reactjs?
Upvotes: 2
Views: 56
Reputation: 3662
I would say separate them. If you ever wanted to rebuild your API with Node.js or Python for example, it will make it much easier than trying to rip out all of your Rails code, and Vice Versa– If you wanted to keep your Rails API and build out a new front-end with Angular it makes it easier.
Another thing to keep in mind is scalability. When your front-end code is separate from your back-end code, you can scale up your backend independently, which would ultimately save you money. This is more applicable to large scale applications though.
Also deployment. If you need to make updates to your API, you shouldn't have to re-deploy all of your front end code as well.
Upvotes: 1