-
Notifications
You must be signed in to change notification settings - Fork 51
/
run.js
31 lines (25 loc) · 1.03 KB
/
run.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
/*
* Trello burndown chart generator
*
* Author: Norbert Eder <wpfnerd+nodejs@gmail.com>
*/
var fs = require('fs');
var path = require('path');
global.settings = require('./settings');
settings.root = __dirname.replace(/\/+$/, "");
settings.exportPath = path.join(settings.root, 'export');
settings.configPath = path.join(settings.root, 'config');
settings.templatePath = path.join(settings.root, 'templates');
settings.sprintTemplatePath = path.join(settings.root, 'templates' + path.sep + settings.template);
settings.homeTemplatePath = path.join(settings.root, 'templates' + path.sep + settings.home_template);
if (process.env.PORT) settings.port = process.env.PORT;
// if export path does not exist, create it
if (!fs.existsSync(settings.exportPath)) {
fs.mkdirSync(settings.exportPath);
}
// if config path does not exist, create it
if (!fs.existsSync(settings.configPath)) {
fs.mkdirSync(settings.configPath);
}
var server = require('./lib/server');
require('http').createServer(server).listen(settings.port);