-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
36 lines (30 loc) · 1.01 KB
/
server.js
File metadata and controls
36 lines (30 loc) · 1.01 KB
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
var _ = require("underscore"),
Promise = require("bluebird"),
thicket = require("thicket"),
Logger = thicket.c("logger"),
CLA = thicket.c("appenders/console-log"),
App = thicket.c("app"),
Bootstrapper = thicket.c("bootstrapper");
var Log = Logger.create("MySampleApp");
var MySampleApp = function() {
this.initialize.apply(this, arguments);
};
_.extend(MySampleApp.prototype, App.prototype, {
initialize: function() {
App.prototype.initialize.apply(this, arguments);
},
up: Promise.method(function() {
Log.debug("Look at me, doing some meaningful setup work...");
}),
down: Promise.method(function() {
Log.debug("Look at me, doing some meaningful teardown work...");
})
});
Logger.root().setLogLevel(Logger.Level.Debug);
Logger.root().addAppender(new CLA());
var bootstrapper = new Bootstrapper({applicationConstructor: MySampleApp});
bootstrapper
.bootstrap()
.then(function(appContainer) {
return appContainer.start();
});