-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathserver.js
More file actions
28 lines (22 loc) · 676 Bytes
/
server.js
File metadata and controls
28 lines (22 loc) · 676 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
var express = require('express.io');
var swig = require('swig');
var dcr = require(__dirname + '/desktop-command-remote.js');
var app = express();
app.http().io();
var s = new dcr.Server(app);
app.configure(function(){
app.use(express.cookieParser());
app.use(express.bodyParser());
});
// port
port = 3000;
// get ip to print server internal location
require('dns').lookup(require('os').hostname(), function (err, addr, fam) {
console.log("Web interface running at http://" + addr + ":" + port + "/");
});
s.config(__dirname + "/configure.js");
s.init(function(){
app.listen(port, function(){
console.log("Server is running on port: " + port);
})
})