Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Add CORS setup #39

Open
wtrocki opened this issue Oct 13, 2020 · 6 comments
Open

Add CORS setup #39

wtrocki opened this issue Oct 13, 2020 · 6 comments
Labels
good first issue Good for newcomers gsoc

Comments

@wtrocki
Copy link
Contributor

wtrocki commented Oct 13, 2020

It seems that docker image provided is not working. Some issues we saw when gw is containerized.

  • Cors are not enabled, so impossible to hook in OVP queries into it.

  • I need to change the network interface to 0.0.0.0 instead of localhost, to get me to work expose the 8080 and use GraphiQL IDE it from my browser.

  • Somehow I cannot proxy requests deployed. This happens also in my machine locally as I am seeing these warning messages when starting gw:
    docker run -it --rm -p 4000:8080 quay.io/graphql/ovp-gateway
    2020/10/13 15:34:18 loaded previously stored schema: upstreams/gateway.graphql
    2020/10/13 15:34:18 loaded previously stored schema: upstreams/serverless1.graphql
    2020/10/13 15:34:18 The upstream does not have any query entry points
    2020/10/13 15:34:18 The upstream does not have any query entry points
    2020/10/13 15:34:18 The upstream does not have any mutation entry points
    2020/10/13 15:34:18 The upstream does not have any subscription entry points
    2020/10/13 15:34:18 GraphQL endpoint is running at http://[::]:8080/graphql
    2020/10/13 15:34:18 Gateway GraphQL IDE is running at http://[::]:8080/graphiql

@wtrocki
Copy link
Contributor Author

wtrocki commented Oct 14, 2020

Could not figure out how to add cors stuff easily.

@wtrocki wtrocki added the gsoc label Feb 13, 2021
@wtrocki wtrocki changed the title Cannot use docker container Add CORS setup Feb 15, 2021
@wtrocki wtrocki added the good first issue Good for newcomers label Feb 15, 2021
@lmnzx
Copy link

lmnzx commented Feb 17, 2021

Since this project uses the "net/http", I think we have to use an external library to implement cors, https://github.com/rs/cors seems to a great library for this purpose.

@wtrocki
Copy link
Contributor Author

wtrocki commented Feb 17, 2021

@snxk Amazing choice!

@chirino let us know if you are against it. If not we going to add that

@adityaofficial10

This comment has been minimized.

@wtrocki
Copy link
Contributor Author

wtrocki commented Feb 20, 2021

Anyone could work on this. Let's do quick fix first - setup hardcoded header - which is one liner. Then we can extract config

@chirino
Copy link
Collaborator

chirino commented Feb 20, 2021

Sounds good to me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers gsoc
Projects
None yet
Development

No branches or pull requests

4 participants