You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/pages/docs/integrations/integration-with-express.mdx
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,3 +37,24 @@ app.listen(4000, () => {
37
37
```
38
38
39
39
> You can also check a full example on our GitHub repository [here](https://github.com/dotansimha/graphql-yoga/tree/v3/examples/express)
40
+
41
+
## Custom endpoint
42
+
43
+
By default, GraphQL Yoga will bind to the `/graphql` endpoint. You can change this behavior by passing a `graphqlEndpoint` option to the `createYoga` function.
44
+
45
+
```ts
46
+
importexpressfrom'express'
47
+
import { createYoga } from'graphql-yoga'
48
+
49
+
const app =express()
50
+
51
+
const yoga =createYoga({
52
+
graphqlEndpoint: '/custom/endpoint'
53
+
})
54
+
55
+
app.use('/custom/endpoint', yoga)
56
+
57
+
app.listen(4000, () => {
58
+
console.log('Running a GraphQL API server at http://localhost:4000/graphql')
0 commit comments