factor to nodejs application

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent 8cb80b9cbe
commit b237b857c7
10 changed files with 764 additions and 0 deletions

16
index.js Normal file
View file

@ -0,0 +1,16 @@
import express from "express";
import expressW from "express-ws";
var app = express();
expressW(app);
app.use(express.static('./static'));
app.ws('/', function (ws, req) {
ws.on('message', function (msg) {
console.log(msg);
});
console.log('socket', req.testing);
});
app.listen(process.env.PORT || 3069);