forked from deepforge-dev/deepforge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
29 lines (23 loc) · 758 Bytes
/
app.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
// jshint node: true
'use strict';
var gmeConfig = require('./config'),
webgme = require('webgme'),
path = require('path'),
fs = require('fs'),
rm_rf = require('rimraf'),
gracefulFs = require('graceful-fs'),
myServer;
process.chdir(__dirname);
webgme.addToRequireJsPaths(gmeConfig);
// Patch the 'fs' module to fix 'too many files open' error
gracefulFs.gracefulify(fs);
// Clear seed hash info
['nn', 'pipeline'].map(lib => path.join(__dirname, 'src', 'seeds', lib, 'hash.txt'))
.forEach(file => rm_rf.sync(file));
myServer = new webgme.standaloneServer(gmeConfig);
myServer.start(function (err) {
if (err) {
process.exit(1);
}
console.log('DeepForge now listening on port', gmeConfig.server.port);
});