Skip to content

Commit b3025cf

Browse files
authored
Merge pull request #136 from microsoftgraph/dependabot/npm_and_yarn/socket.io-3.0.1
Bump socket.io from 2.3.0 to 3.0.1
2 parents d8a9787 + d5f2b70 commit b3025cf

File tree

3 files changed

+87
-306
lines changed

3 files changed

+87
-306
lines changed

helpers/socketHelper.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
import express from 'express';
22
import http from 'http';
33
import io from 'socket.io';
4+
import { subscriptionConfiguration, msalConfiguration } from '../constants';
45

56
const socketServer = http.createServer(express);
6-
export const ioServer = io(socketServer);
7+
export const ioServer = io(socketServer, {
8+
cors: {
9+
origin: [
10+
msalConfiguration.redirectUri.substring(0, msalConfiguration.redirectUri.lastIndexOf('/')),
11+
subscriptionConfiguration.notificationUrl.substring(0, subscriptionConfiguration.notificationUrl.lastIndexOf('/'))],
12+
methods: ['GET', 'POST']
13+
}
14+
});
715

816
socketServer.listen(3001);
917

0 commit comments

Comments
 (0)