Initial commit: EduBox V2 platform
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { WebSocketServer } from "ws";
|
||||
import { initWebSocketServer } from "@/lib/websocket";
|
||||
|
||||
const globalWss = globalThis as typeof globalThis & { __eduboxWss?: WebSocketServer };
|
||||
|
||||
if (!globalWss.__eduboxWss) {
|
||||
try {
|
||||
globalWss.__eduboxWss = new WebSocketServer({ port: 3001 });
|
||||
initWebSocketServer(globalWss.__eduboxWss);
|
||||
} catch {
|
||||
// Port may be in use during build or hot reload
|
||||
}
|
||||
}
|
||||
|
||||
export async function GET() {
|
||||
return new Response("WebSocket server running on port 3001", { status: 200 });
|
||||
}
|
||||
Reference in New Issue
Block a user