I'm running postgraphile and apollo to get data for my react app. I am using npm concurrently to run the react server and to run postgraph using the CLI including --cors flag. Everything works fine when i run the app locally. When I upload everything to AWS elastic beanstalk, I can't access app.com:5000/graphiql and the app gives me a 408 timeout error code saying it is a problem with HTTPLink, then tells me there is a cross origin error. If i run the app on AWS and have it point to my localhost:5000/graphiql it works perfectly, but not when it is deployed to AWS. The part that confuses me is that it does not have a cross origin error when it is going from AWS to my localhost, but it does have a cross origin error when it's going from AWS to AWS.
Asked
Active
Viewed 140 times
0

sideshowbarker
- 81,827
- 26
- 193
- 197

Sdarb
- 173
- 1
- 10
-
1The 408 timeout error is the problem you need to fix. The fact the 408 response doesn’t have an Access-Control-Allow-Origin header is irrelevant to the actual problem. Even if the 408 response did have an Access-Control-Allow-Origin header, you’d still have a 408 timeout error preventing you from getting the response you need. – sideshowbarker Jan 25 '19 at 01:45
1 Answers
1
By default PostGraphile binds to localhost; it sounds like you need it to bind to all interfaces. Try the --host 0.0.0.0
option documented here:

Benjie
- 7,701
- 5
- 29
- 44