I know this isn't directly related to KGraphql, bu...
# kgraphql
m
I know this isn't directly related to KGraphql, but I'm trying to host my server on ec2. But when I open [public ip]:8080/grahpql, I cannot connect to it. I see a blank page on Firefox. My inboud rules look like this:
But if I do a simple GET call from the routing DSL, it works all right!
j
I have no experience with EC2
but I think this is because of CORS
and remember the graphql playground is not enabled by default. So you need to have
playground = true
m
almost def cus of cors, I was using this with ktor and had to define customers headers and whatnot. Whatever framework you are using likely has documentation on how to work with cors
j
if you are using ktor. You could try this:
install(CORS) { anyHost() }
This is ofcourse not the correct solution. But if that does not fix it, then cors is not the reason.
m
No luck with configuring CORS in Ktor 😐
j
Could you share the error you are getting? by opening the chrome inspector(or whatever browser you use 😛) and under the network tab.