https://kotlinlang.org logo
Title
m

manlan

11/16/2020, 5:08 PM
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

jeggy

11/16/2020, 6:01 PM
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

Mattlangsenkamp

11/17/2020, 5:14 AM
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

jeggy

11/17/2020, 4:06 PM
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

manlan

11/18/2020, 1:16 PM
No luck with configuring CORS in Ktor 😐
j

jeggy

11/18/2020, 2:01 PM
Could you share the error you are getting? by opening the chrome inspector(or whatever browser you use 😛) and under the network tab.