-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunchServer.js
More file actions
29 lines (26 loc) · 840 Bytes
/
Copy pathlaunchServer.js
File metadata and controls
29 lines (26 loc) · 840 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
var express = require('express'),
_ = require('underscore'),
child = require('child_process'),
c = require('chalk'),
pj = require('prettyjson');
dir = require('node-dir'),
fs = require('fs-extra'),
app = new express();
var SOURCE_APP = __dirname + '/__agar.io-clone',
SERVERS_DIR = __dirname + '/__SERVERS',
APP_PREFIX = '__agar_server_';
module.exports = function(S, _cb) {
var server = child.exec('node ' + S.script, {
cwd: S.cwd
});
server.on('close', function(code, signal) {
console.log('server closed w code', code);
});
server.stdout.on('data', function(dat) {
console.log(c.green('server out'), dat.toString());
});
server.stderr.on('data', function(dat) {
console.log(c.red('server err'), dat.toString());
});
_cb(null, {});
};