-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
executable file
·41 lines (29 loc) · 906 Bytes
/
server.js
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
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
var log = require('./libs/logger').log;
log.info('Initializing ...')
var spawn = require('child_process').spawn;
var argv = require('optimist').argv;
// Evilprobe's libs
global.knownPorts = require('./libs/portlist');
var jsUtils = require('./libs/jsUtils');
var db = require('./libs/db');
var app = require('./libs/app');
// Webserver setup
global.port = 81;
global.host = 'localhost';
// Qooxdoo redirect, can be /source/ or /build/
global.redirect = '/source/';
// Background tasks
global.procs = {}
// session
// TODO: but that in mongodb with TTL !
global.sessions = {}
// Faye/bayeux setup
global.bayeux = require('./libs/bayeux');
app.start();
global.bayeuxClient = new bayeux.Client('http://'+host+':'+port+'/faye');
// Job manager
global.jobs = {};
global.jobManager = require('./libs/job');
global.jobManager.setDebug(argv.debug||false);
global.jobManager.init();