I am in the process of standing up my first create...
# orm-help
k
I am in the process of standing up my first create-react-app client + graphql-yoga server + prisma + db Docker container stack on AWS and I'm very excited. Besides that, if anyone could give me a quick suggestion on the critical matter of changing the uri in my client's initialization of Apollo's http link in its
index.js
depending on some build configuration? Right now it's hardcoded to
<http://localhost:4000>
(and
<ws://localhost:4000>
for subscriptions) - is there a standard practice to change this value as obviously something like an ENV var won't suffice as it is client code running on a visitor's browser.
n
where are you deploying the app to?
k
A dinky little ec2 instance I have for free. I'm considering just hard coding it for a one-time try to an address like http://ec2-##-###-##-###.compute-1.amazonaws.com:4000
This isn't a prisma-specific question but I figured someone who's had this experience would be able to go "oh yeah, totally just follow this link here!" since I'm following the very common suggested path of React+Apollo+Prisma.
😄 1
n
the thing is, the client just downloads the code you deploy, so during deploy, you can use env vars to change the URL
😲 1
just found this as well, looks to cover the topic quite nicely: https://daveceddia.com/multiple-environments-with-react/
k
Ahhhhhhh, that seems to be exactly what I'm looking for. Thanks a ton!
🙌 1