File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import serverless from 'serverless-http';
5
5
import dotenv from 'dotenv' ;
6
6
import http from 'http' ;
7
7
import RateLimit from 'express-rate-limit' ;
8
- import { Server } from 'socket.io' ;
9
8
10
9
import yoRoutes from './routes/yo' ;
11
10
import './models/yo' ;
@@ -14,15 +13,6 @@ dotenv.config();
14
13
15
14
mongoose . Promise = global . Promise ;
16
15
17
- // Extend Express type to include `io`
18
- declare global {
19
- namespace Express {
20
- interface Application {
21
- io ?: Server < ClientToServerEvents , ServerToClientEvents , InterServerEvents , SocketData > ;
22
- }
23
- }
24
- }
25
-
26
16
// Connect to MongoDB
27
17
async function connectToDB ( ) {
28
18
try {
@@ -87,11 +77,6 @@ interface SocketData {
87
77
age : number ;
88
78
}
89
79
90
- // Initialize Socket.io
91
- const server = http . createServer ( app ) ;
92
- const io = new Server < ClientToServerEvents , ServerToClientEvents , InterServerEvents , SocketData > ( ) ;
93
- app . io = io ; // Assign io to the app
94
-
95
80
// Wrap the Express app with serverless-http for AWS Lambda
96
81
const serverlessApp = serverless ( app ) ;
97
82
You can’t perform that action at this time.
0 commit comments