session start works
This commit is contained in:
24
backend/src/index.ts
Normal file
24
backend/src/index.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import express from 'express';
|
||||
import http from 'http';
|
||||
import { createWebSocketServer } from './ws';
|
||||
import sessionsRouter from './routes/sessions';
|
||||
import cors from 'cors';
|
||||
|
||||
const app = express();
|
||||
const server = http.createServer(app);
|
||||
|
||||
// Middleware
|
||||
app.use(express.json());
|
||||
app.use(cors());
|
||||
|
||||
// API Routes
|
||||
app.use('/', sessionsRouter);
|
||||
|
||||
// Create and attach WebSocket server
|
||||
createWebSocketServer(server);
|
||||
|
||||
const PORT = process.env.PORT || 8000;
|
||||
|
||||
server.listen(PORT, () => {
|
||||
console.log(`Server is running on port ${PORT}`);
|
||||
});
|
||||
Reference in New Issue
Block a user