-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
25 lines (20 loc) · 708 Bytes
/
Copy pathapp.js
File metadata and controls
25 lines (20 loc) · 708 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
var express = require('express');
var path = require('path');
var http = require('http');
var app = express();
app.configure(function () {
app.set('port', process.env.PORT || 8080);
app.set('domain', 'epuakhaw0143');
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.static(path.join(__dirname, 'public')));
});
var server = http.createServer(app).listen(app.get('port'), app.get('domain') , function () {
console.log("Express server listening on port " + app.get('port'));
});
var io = require('socket.io').listen(server);
io.sockets.on('connection', function (socket) {
socket.on('setorientation', function(data){
io.sockets.emit('getorientation', data);
});
});