eseom / hapi-react-fullstack-boilerplate

Hapi, Sequelize, React, etc.
MIT License
21 stars 4 forks source link

Separate backend API server from frontend SSR server #2

Closed ghost closed 7 years ago

ghost commented 7 years ago

Once again, thanks for the fantastic boilerplate! I've already integrated your Hails project locally (kind of a must if I want control over your abstraction, sorry :( ) and updated most packages to newer versions.

I think the most common production situation is a clear separation between frontend and backend servers. That is, I don't need to shutdown the backend API to make tweaks to my frontend (and it's own Hapi SSR server). I know you're doing something with Hails which already encapsulates the API server from the SSR part of the server, but I think being able to run them on different servers (physically, API on server 1, SSR server on 2) is better aimed at "production-ready".

I'll have to figure this out myself, any pointers would be welcome, I'll eventually get it :)

Thanks again!

eseom commented 7 years ago

Hi

What is most important thing to me, was ease of development. When I made multiple projects simaltaneously sometimes, I needed to open 10 and more terminals for only for the projects shipped with servers, clients with a proxy, debuggers and more.

To accomplish what you said, the project will have to provide something about separation. In my opinion for now, you can simply create two projects, one for the api and one for the client. And either CORS or an internal proxy will find a way to communicate with each other.

I'll keep thinking about it. Thank you for your feedback.