From 28f00fb1eb488da2cd9a98e191a819f7b95cf8fd Mon Sep 17 00:00:00 2001 From: Jon Fairbanks Date: Mon, 14 Oct 2024 23:51:30 -0700 Subject: [PATCH] More socket.io jazz --- server/index.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/server/index.ts b/server/index.ts index 5324e90..07f1b62 100644 --- a/server/index.ts +++ b/server/index.ts @@ -5,7 +5,6 @@ import serverless from 'serverless-http'; import dotenv from 'dotenv'; import http from 'http'; import RateLimit from 'express-rate-limit'; -import { Server } from 'socket.io'; import yoRoutes from './routes/yo'; import './models/yo'; @@ -14,15 +13,6 @@ dotenv.config(); mongoose.Promise = global.Promise; -// Extend Express type to include `io` -declare global { - namespace Express { - interface Application { - io?: Server; - } - } -} - // Connect to MongoDB async function connectToDB() { try { @@ -87,11 +77,6 @@ interface SocketData { age: number; } -// Initialize Socket.io -const server = http.createServer(app); -const io = new Server(); -app.io = io; // Assign io to the app - // Wrap the Express app with serverless-http for AWS Lambda const serverlessApp = serverless(app);