-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
37 lines (31 loc) · 905 Bytes
/
main.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
var vertx = require("vertx.js");
var console = require('vertx/console');
var container = require('vertx/container');
var logger = container.logger;
var config = container.config;
var eb = vertx.eventBus;
var engines = [ "dustjs-linkedin" ];
var main = function() {
var handler = undefined;
try {
if (config.engine == "dustjs-linkedin") {
var DustHandler = require('dustjs-linkedin');
handler = new DustHandler({
logger : logger,
eb : eb,
// version : config.version ? config.version : "2.0.3"
});
}
} catch (e) {
logger.error(e + "\n" + e.stack);
logger.info('template module crashed during startup');
throw (e);
}
if (handler) {
logger.info('template module started ' + handler.getVersion());
} else {
throw (new Error("could not find template engine '" + config.engine
+ "'. set config.engine to one of these: "
+ JSON.stringify(engines)));
}
}();