fix: improved websocket usage

This commit is contained in:
Lukian 2025-04-08 22:19:06 +02:00
parent fbf7821320
commit 132b1f3c06
7 changed files with 135 additions and 79 deletions

View file

@ -14,6 +14,10 @@ app.use(express.json());
app.use(cookieParser());
app.use(cors());
const { router, socketsMiddleware } = require("./libs/middlewares");
app.use("/api/ws", router);
app.use(socketsMiddleware);
function loadRoutes(folderName) {
const routesPath = path.join(__dirname, folderName);
const files = fs.readdirSync(routesPath);