Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 761b0a8

Browse files
committed
feat(NA): changed ws server to new graphql endpoint.
1 parent 0c7f5a4 commit 761b0a8

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

api/server.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import schema from './schema';
2525
import queryMap from '../extracted_queries.json';
2626
import config from './config';
2727

28-
const SUBSCRIPTIONS_PATH = '/subscriptions';
28+
const WS_GQL_PATH = '/graphql';
2929

3030
// Arguments usually come from env vars
3131
export function run({
@@ -41,9 +41,9 @@ export function run({
4141
port = parseInt(portFromEnv, 10);
4242
}
4343

44-
const subscriptionsURL = process.env.NODE_ENV !== 'production'
45-
? `ws://localhost:${port}${SUBSCRIPTIONS_PATH}`
46-
: `ws://api.githunt.com${SUBSCRIPTIONS_PATH}`;
44+
const wsGqlURL = process.env.NODE_ENV !== 'production'
45+
? `ws://localhost:${port}${WS_GQL_PATH}`
46+
: `ws://api.githunt.com${WS_GQL_PATH}`;
4747

4848
const app = express();
4949

@@ -120,7 +120,7 @@ export function run({
120120

121121
app.use('/graphiql', graphiqlExpress({
122122
endpointURL: '/graphql',
123-
subscriptionsEndpoint: subscriptionsURL,
123+
subscriptionsEndpoint: wsGqlURL,
124124
query: `{
125125
feed (type: NEW, limit: 5) {
126126
repository {
@@ -143,7 +143,7 @@ export function run({
143143

144144
server.listen(port, () => {
145145
console.log(`API Server is now running on http://localhost:${port}`); // eslint-disable-line no-console
146-
console.log(`API Subscriptions server is now running on ws://localhost:${port}${SUBSCRIPTIONS_PATH}`); // eslint-disable-line no-console
146+
console.log(`API Server over web socket with subscriptions is now running on ws://localhost:${port}${WS_GQL_PATH}`); // eslint-disable-line no-console
147147
});
148148

149149
// eslint-disable-next-line
@@ -228,7 +228,7 @@ export function run({
228228
},
229229
},
230230
{
231-
path: SUBSCRIPTIONS_PATH,
231+
path: WS_GQL_PATH,
232232
server,
233233
},
234234
);

0 commit comments

Comments
 (0)