Skip to content

Commit 28f00fb

Browse files
committed
More socket.io jazz
1 parent 727d482 commit 28f00fb

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

server/index.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import serverless from 'serverless-http';
55
import dotenv from 'dotenv';
66
import http from 'http';
77
import RateLimit from 'express-rate-limit';
8-
import { Server } from 'socket.io';
98

109
import yoRoutes from './routes/yo';
1110
import './models/yo';
@@ -14,15 +13,6 @@ dotenv.config();
1413

1514
mongoose.Promise = global.Promise;
1615

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-
2616
// Connect to MongoDB
2717
async function connectToDB() {
2818
try {
@@ -87,11 +77,6 @@ interface SocketData {
8777
age: number;
8878
}
8979

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-
9580
// Wrap the Express app with serverless-http for AWS Lambda
9681
const serverlessApp = serverless(app);
9782

0 commit comments

Comments
 (0)