mirror of
https://github.com/vale981/apollo-server
synced 2025-03-06 02:01:40 -05:00
add middleware example
This commit is contained in:
parent
31609b6853
commit
c26affb990
1 changed files with 3 additions and 1 deletions
|
@ -152,7 +152,9 @@ const server = new ApolloServer({
|
|||
resolvers,
|
||||
});
|
||||
|
||||
registerServer({ server, app }); // app is from an existing express app. Mount middleware here.
|
||||
app.use(jwtCheck, requireAuth, checkScope); // you can mount several middleware at this point to run before Apollo.
|
||||
|
||||
registerServer({ server, app, '/specialUrl' }); // app is from an existing express app. Mount Apollo middleware here. If no path is specified, it defaults to `/graphql`.
|
||||
```
|
||||
|
||||
## `gql`
|
||||
|
|
Loading…
Add table
Reference in a new issue