Closed cmosguy closed 8 years ago
Hi. You can dispatch for example getUserInfo
action on serer which can use isomorphic helper to make a XMLHttpRequest on client or HTTP request from server with JWT token. This way your app can be prerendered on server and client will smoothly mount on state.
Hi @langpavel so I did more of a my homework, it appears that I did not completely understand isomorphic web apps clearly. Since the components are rendered on the server, then assuming that the PHP serves the HTML is not going to happen. However, it will serve the API, which is basically OPTION #1 above.
@langpavel, I just realized that I need to understand how to dispatch all the setLocal, setMe functions from the client.
There are two options for the serverr setup:
I was planning on doing OPTION 2, but the code relies on server.js.
Here is a snippet from the code:
I also want to do a
store.dispatch(setMe{})
to fetch my PHP servers API to get the "me" info. This is an example API from the server. I will use this to help me learn how to fetch other requests and objects from the server as well.Is it possible to move the stuff from server.js so I can inject the store from my PHP server for OPTION #2?