简体   繁体   中英

408 timeout error with postgraphile on AWS elastic beanstalk

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.

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:

https://www.graphile.org/postgraphile/usage-cli/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM