Graphql Express Server + Create React App DEPLOYMENT?

Graphql Express Server + Create React App DEPLOYMENT?
0

#1

I have been developing the polling app project on cloud 9, as i do all my projects. It is really two different apps at this point. I use the “proxy” setting in my package.json and am running the create-react-app dev server and my graphql express server on the same host just on different ports.

Everything is working great, but I am a little unsure on the best ways to deploy. I have been trying to deploy the graphql to heroku on its own and run the create react app dev server through that, but that hasn’t worked for me. My graphql server uses subscriptions and my front end uses apollo and connects to the backend with their hybrid network interface - both https and wss websocket for the subscriptions. I was getting all kinds of errors when i deployed my server on heroku. I have realized that I know very little about deployment at this point.

Also, there is the possibility of running everything from the graphql server after I build my create-react-app. In the past I have had success serving my create-react-app build this way, but this was without a full on API. There are so many options out there for deployment I am a little confused about which way to go here.

If someone has experience with this set up and knows a straight-forward way to deploy, or knows of some good resources on the subject please post up. Thanks.


#2

Hey, although this is an old post , I came across is whilst trying to solve a similar problem and have since found a solution. So thought i’d share just in case yourself, or someone else on a google binge lands here and finds it useful.

These articles solved the deployment solutions for me.

deploying-a-react-app-with-a-server

using-create-react-app-with-a-server