cereallarceny / cra-ssr

[DEPRECATED] Server-side rendering with create-react-app, React Router v4, Helmet, Redux, and Thunk
484 stars 118 forks source link

Run API and SSR on the same server #6

Closed leonardoanalista closed 6 years ago

leonardoanalista commented 6 years ago

I know for kind of real world apps it is recommended to have the SSR in a separate server from the API.

However, many times we want to build a POC or the app is not yet big enough to deserve this separation.

In any cases I would like to achieve this. When I run this in my browser http://localhost:3000/api, browser displays cached off-line app contents from the ServiceWorker. This makes sense when it is not a API request.

How to reproduce this situation:

If you alternate between normal reload and hard reload for the same http://localhost:3000/api you get different results each time

I understand this is not a bug in your boilerplate. I am just trying to get some help here.

cereallarceny commented 6 years ago

Hey @leonardoanalista - I just released a new version of cra-ssr. Check it out on master. I think it should fix your issue, which I'll close unless you confirm it still needs to be addressed!