Skip to content

Commit 4341533

Browse files
committed
fix: rename NORTHWIND_WS_URL to SUBSCRIPTION_ENDPOINT
1 parent 037e9ad commit 4341533

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ httpServer.listen(PORT, () => {
5252
},
5353
{
5454
server: httpServer,
55-
path: process.env.NORTHWIND_WS_URL || `ws://localhost:${PORT}/northwind`,
55+
path: '/northwind',
5656
}
5757
);
5858
});
@@ -64,14 +64,18 @@ function addExample(example, uri) {
6464
schema: example.schema,
6565
introspection: true,
6666
playground: {
67-
subscriptionEndpoint: example.uri,
67+
subscriptionEndpoint: process.env.SUBSCRIPTION_ENDPOINT || `ws://localhost:${PORT}/northwind`,
6868
},
6969
});
7070
server.applyMiddleware({ app, path: example.uri });
7171

7272
app.use(
7373
`${example.uri}-altair`,
74-
altairExpress({ endpointURL: example.uri, subscriptionsEndpoint: example.uri })
74+
altairExpress({
75+
endpointURL: example.uri,
76+
subscriptionsEndpoint:
77+
process.env.SUBSCRIPTION_ENDPOINT || `ws://localhost:${PORT}/northwind`,
78+
})
7579
);
7680
app.use(`${example.uri}-voyager`, voyagerMiddleware({ endpointUrl: example.uri }));
7781
addToMainPage(example);

0 commit comments

Comments
 (0)