-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
49 lines (38 loc) · 889 Bytes
/
index.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
42
43
44
45
// Get argv > args
var arvRegexp = /^([\w]+)\=(.*)$/;
var args = {
port: 3000,
debug: true,
timeout: 10000,
renderReload: true
};
for(var i=0,l=process.argv.length;i<l;i++){
if(arvRegexp.test(process.argv[i])){
var m = arvRegexp.exec(process.argv[i]);
args[m[1]]=m[2];
}
}
// Pillars.js load
var project = require('pillars').configure({
renderReload: args.debug,
debug: args.debug
});
// HTTP service start
project.services.get('http').configure({
timeout: parseInt(args.timeout,10),
port: parseInt(args.port,10)
}).start();
// Internacionalization config
i18n.languages = ['es'];
// Log manager config
var crier = global.crier.addGroup('pillarsdocs');
// Static service
var pillarsDocsStatic = new Route({
id:'pillarsDocsStatic',
path:'/*:path',
directory:{
path:'./static',
listing:true
}
});
project.routes.add(pillarsDocsStatic);