Instructions on hooking up to react-starter-kit
See original GitHub issueHi there,
I recently cloned react-starter-kit from kriasoft and already started to build out my front-end with it. One thing I’d really love to do is use this nodejs-api-starter to communicate with the react-starter-kit, although I’m unsure of where to go. Most likely I’d need to modify the nginx proxy_pass, but need a little push in the right direction.
For now my workflow looks like: yarn start
on react-starter-kit in one tab, and then docker-compose up -d
in another tab which starts the API server.
My goal is to be able to build out all my REST endpoints on with the nodejs-api-starter and have my client talk to the react-starter-kit.
FWIW, I’m running react-starter-kit on port 3001 and the nodejs-api-starter runs on 8080.
<bountysource-plugin>Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top GitHub Comments
If you are running two separate servers for each project, you can easily communicate between these two projects over HTTP. Just send HTTP requests from the
react-starter-kit
client/server to this api running on another machine/port.I wouldn’t necessarily recommend that though, because the two projects have a lot of overlap. They both handle authentication and they both run a
graphql
server. That’s a lot of redundancy. I would use one or the other. Basically,react-starter-kit
is a full stack example and this is just a backend.You can easily modify this project to also serve your front-end though. Just serve your front-end here. I’m doing something like this…
Then you can generate your
bundle.min.js
file however you wish and place it in a/public
folder in the root of this project. This file could be a react.js project or any other type of front-endangular
,vue
, whatever.react-starter-kit
is just a more opinionated version of this that implements an isomorphic react.js client as well as the backend (and of course doesn’t have any of thedocker-compose
awesomeness).I am actually working towards a very similar setup and use reverse-proxies via nginx
Here’s a link that might help give you some more direction, although RSK has changed a lot since this PR
Remove data API endpoint from the boilerplate #1057