mirror of
https://github.com/randyjc/Rahoot.git
synced 2026-03-13 20:15:35 +01:00
First Commit
This commit is contained in:
14
socket/web.js
Normal file
14
socket/web.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { Server } from "socket.io"
|
||||
|
||||
const io = new Server({
|
||||
cors: {
|
||||
origin: "*",
|
||||
},
|
||||
})
|
||||
|
||||
io.on("connection", (socket) => {
|
||||
console.log("a user connected")
|
||||
io.to(socket.id).emit("message", "Hello from server")
|
||||
})
|
||||
|
||||
io.listen(5057)
|
||||
Reference in New Issue
Block a user