unibutton/index.js

18 lines
No EOL
373 B
JavaScript

import express from "express";
import expressW from "express-ws";
var app = express();
expressW(app);
app.use('/js',express.static('./common'));
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);