Add feedback

This commit is contained in:
unicodeveloper 2018-06-28 16:13:36 +01:00
parent 290b9f05f7
commit 06db214fc1

View file

@ -4,24 +4,16 @@ sidebar_title: Now
description: Deploying your GraphQL server to Zeit Now
---
`now` is a service by Zeit that allows you to deploy an instance of Apollo Server and have a functional GraphQL endpoint. `now` supports three types of deployments for web apps: `static`, `node.js`, and `Docker`. We'll focus on the Node.js deployment for this guide.
`Now` is a service by Zeit that allows the deployment of an instance of Apollo Server, which provides a functional GraphQL endpoint.
## Node.js Deployment
Deployment to `now` for node apps simply requires a `package.json` file to be present in your app directory. Your server directory has a `package.json` file.
Deployment to `now` for Node.js apps simply requires a `package.json` file to be present in your app directory.
```js
{
"name": "graphqlservice",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"apollo-server": "^2.0.0-rc.5",
"graphql": "^0.13.2"
@ -31,7 +23,7 @@ Deployment to `now` for node apps simply requires a `package.json` file to be pr
### Deploy server to Now
Install the [now cli](https://zeit.co/download#now-cli), then visit your server directory and run the `now` command:
Install the [now CLI](https://zeit.co/download#now-cli), then visit your server directory and run the `now` command:
```sh
$ now
@ -41,18 +33,18 @@ The `now` command immediately deploys your server to the cloud and returns the h
### Deploying directly from GitHub
If you have your GraphQL server published to GitHub, `now` provides the ability to deploy straight from GitHub to the cloud.
If you have your GraphQL server published to GitHub, `Now` provides the ability to deploy straight from GitHub to the cloud.
Assuming you'd like to deploy an instance of [unicodeveloper](https://github.com/unicodeveloper)'s [graphql-server](https://github.com/unicodeveloper/graphql-server), this is what you'll do:
Assuming you'd like to deploy an instance of [apollo](https://github.com/apollographql)'s [graphql-server-example](https://github.com/apollographql/graphql-server-example), this is what you'll do:
```sh
$ now unicodeveloper/graphql-server
$ now apollographql/graphql-server-example
```
The `graphql-server` in this example is connected to Apollo Engine and requires an API key for it to send reports to Engine. You can pass in environment variables such as `ENGINE_API_KEY` like so:
The `now` command deploys right away and gets the server up and running on the cloud. Furthermore, running the following command will automatically start delivering reports to Apollo Engine.
```sh
$ now -e ENGINE_API_KEY=xxxxxxxxx unicodeveloper/graphql-server
$ now -e ENGINE_API_KEY=xxxxxxxxx apollographql/graphql-server-example
```
<div style="text-align:center">