From b6bdfdbbad7426b57e3e209026452bbc052a244d Mon Sep 17 00:00:00 2001 From: Jesse Rosenberger Date: Wed, 25 Apr 2018 22:15:34 +0300 Subject: [PATCH] docs: Add instruction for `applyMiddleware`. --- docs/source/essentials/server.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/essentials/server.md b/docs/source/essentials/server.md index 95570811..6c615ac8 100644 --- a/docs/source/essentials/server.md +++ b/docs/source/essentials/server.md @@ -109,6 +109,12 @@ const server = new ApolloServer({ }); ``` +When adding Apollo Server to an existing server, it's necessary to indicate, relative where to activate the middleware relative to other middlewares already in the app. To do this, add the following line along with your other middleware, preferably before any of the others: + +```js +server.applyMiddleware(); +``` + > See the [API Reference](../api/apollo-server.html) for additional options which can be passed to the `ApolloServer` constructor. ### Listening for requests