This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { PrismaClient } from '@prisma/client' | |
| const prisma = globalThis.prisma ?? new PrismaClient(); | |
| if (process.env.NODE_ENV !== 'production') globalThis.prisma = prisma; | |
| export default prisma; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mongoose from "mongoose"; | |
| type connectionObject = { | |
| isconnected?: number | |
| } | |
| const connection : connectionObject = {} | |
| async function dbconnect(): Promise<void> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { WebSocketServer, WebSocket } from "ws"; | |
| const wss = new WebSocketServer({port: 8080}); | |
| interface User { | |
| socket: WebSocket | |
| roomId: string | |
| } | |
| let allSocket: User[] = [] |