The GraphQL server module of Grial
Required enviroment variables
- NODE_ENV => the app running environment (default
- BASE_PATH => the path where the required files are located (default
- PORT => the app running port
- HOST => the app running host
- PUBLIC_PORT => the app public port (default to
PORT), required inside Docker
- PUBLIC_HOST => the app public host (default to
HOST), required inside Docker
- SUBSCRIPTION_PATH => the app subscriptions path (default
- SSL_ENABLED => if the app is running with SSL (HTTPS and WSS)
npm i @grial/server
It will load it and use it to start your API server.
You can avoid
@grial/cli and just create a
server.js file with a code similar to this.
const Grial = ;const createServer = ;const api = processenv;const handle = api;api
That way you can run a Express application and use the Grial request handler for your API, it will handle the /graphql and /ide urls and call the next middleware if the URL doesn't match.
It also allow you use use something like
nodemon to watch file changes in your API.