1 | # graphql-playground-middleware-express
|
2 |
|
3 | > Express middleware to expose an endpoint for the GraphQL Playground IDE
|
4 |
|
5 | ## Installation
|
6 |
|
7 | Using yarn:
|
8 |
|
9 | ```console
|
10 | yarn add graphql-playground-middleware-express
|
11 | ```
|
12 |
|
13 | Or npm:
|
14 |
|
15 | ```console
|
16 | npm install graphql-playground-middleware-express --save
|
17 | ```
|
18 |
|
19 | ## Usage
|
20 |
|
21 | See full example in [examples/basic](https://github.com/prisma/graphql-playground/tree/master/packages/graphql-playground-middleware-express/examples/basic).
|
22 |
|
23 | ```js
|
24 | const express = require('express')
|
25 | const expressPlayground = require('graphql-playground-middleware-express')
|
26 | .default
|
27 |
|
28 | const app = express()
|
29 |
|
30 | app.get('/playground', expressPlayground({ endpoint: '/graphql' }))
|
31 | ```
|