This service exposes a GraphQL API via HTTP. It provides the main gateway for client applications. It does not implement business logic. To separate concerns, this service honors the main ideas behind GraphQL.
The HTTP endpoints are defined through Koa.
A live version of this project can be found at coalmines.ruhr.
As of Apollo Server 2, GraphQL Playground is available on /graphql
as a UI.
However, it is not sending cookies, breaking cookie-based authentication.
For a workaround,
open the settings in the UI (gear icon in the upper right), and set
"request.credentials": "same-origin"
.
For a consistent user experience, GraphiQL is still available on /graphiql
.
- Node.js
- npm
- Babel CLI tools
See env.sh
. Set NODE_ENV
to production
for production mode.
For authentication integration, you will need to set up the app for the
respective authentication provider first. Then set APP_URL
to match the
protocol and host where you deployed the app, e.g., https://coalmines.ruhr
.
For each provider, set the environment variables for the credentials to
the respective values the provider gives you.
Providers supported:
- GitHub:
GITHUB_CLIENT_ID
andGITHUB_CLIENT_SECRET
- Twitter:
TWITTER_CONSUMER_KEY
andTWITTER_CONSUMER_SECRET
By default, log output is in plain console format. When running this service in production mode, the output is in JSON format.
A health check endpoint implementing
Nadareishvili's IETF draft
is available at /.well-known/apollo/server-health
.
To run the app, set the necessary environment variables based on the file
env.sh
.
Run the application in watch mode for development purposes:
npm start
You should provide the requirements as stated above through your build system.
make distclean && make
If your binaries are in paths other than defined in the Makefile
, you can
specify them, for example:
make distclean && make NODE=/usr/local/bin/node8
To create a tarball (by default put in build/bundle.tar.gz
):
make dist
make distclean && make && make dist