A simple server to have a GraphiQL UI playground for your API, it handles authentication and proxies all API calls (avoiding CORS)
We make it easy to deploy as a free Heroku app.
Just press the button above and fill in the following environment variables:
GS_APP_URL: https://<heroku-app-name>
.herokuapp.com
The <heroku-app-name>
is the name that you choose for your app on Heroku.
This will be the base Url for the callback on the OAuth2 auth flow.
If you want to use your own domain, you can add it here or change it latter on app settings tab.
GS_SESSION_SECRET: This is the secret used to sign the session ID cookie, used by express-session.
GS_GRAPHQL_URL: Your GraphQL endpoint.
GS_OAUTH2_AUTHORIZATION_URL: Your OAuth2 authorization endpoint.
GS_OAUTH2_TOKEN_URL: Your OAuth2 token endpoint.
GS_OAUTH2_CLIENT_ID: Your OAuth2 client ID.
GS_OAUTH2_CLIENT_SECRET: Your OAuth2 client secret.
For both methods you need to have the environment variables configured, see the
.envrc.sample
file for more info.
Install Node and run:
npm install
npm start
Install Docker and run:
docker-compose up app
# the first time it can take some time depending on your internet connection
- Supports only OAuth2 authentication flow now. (We need your help to make it better and add more :)
- Proxy all the GraphQL API calls through the server, this way the tokens only live on the server side and it's possible to use API's without CORS enabled.
- Add support for others authentication methods.
- Any idea? Open an issue and let's talk :)
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
See Releases for detailed changelog.
MIT License © Digital Natives