-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
32 lines (24 loc) · 742 Bytes
/
server.js
File metadata and controls
32 lines (24 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
let port = process.env.PORT || 8000;
let express = require('express');
let app = express();
let server = require('http').createServer(app).listen(port, function(){
console.log('Server is listening at port: ', port);
});
app.use(express.static('public'));
const io = require("socket.io")(server, {
cors: {
origins: [
"http://autonomylab-blazepose-bodytracking.glitch.me",
"http://autonomylab-blazepose-bodytracking.glitch.me",
"http://marionette-final.glitch.me",
"https://marionette-final.glitch.me"
],
methods: ["GET", "POST"]
}
});
io.on('connection', function (socket) {
socket.on('results', function(data){
// console.log(data)
socket.broadcast.emit('sphereMove', {data})
})
});