Skip to content

Commit

Permalink
cors added
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgeoge1 committed Feb 6, 2025
1 parent 621239d commit 3ca09b2
Show file tree
Hide file tree
Showing 4 changed files with 849 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import logger from './src/config/logger';
// Import routes without default
import { router as routes } from './src/routes';
import { connectDB } from './src/config/database';
import { WebSocketService } from './src/modules/websocket.service';
import { WebSocketService } from './src/modules/websocket/websocket.service';
import { createServer } from 'http';
import cors from 'cors';

// Load environment variables
dotenv.config();
Expand All @@ -19,6 +20,7 @@ const wsService = new WebSocketService(httpServer);
// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(cors());

// Add logging middleware
app.use((req: Request, res: Response, next: NextFunction) => {
Expand Down
Loading

0 comments on commit 3ca09b2

Please sign in to comment.