factor to nodejs application
This commit is contained in:
parent
8cb80b9cbe
commit
b237b857c7
10 changed files with 764 additions and 0 deletions
16
index.js
Normal file
16
index.js
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue