-
Notifications
You must be signed in to change notification settings - Fork 11
/
app.js
52 lines (42 loc) · 1.26 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// -- Module dependencies.
var express = require('express'),
http = require('http'),
less = require('less'),
colors = require('colors'),
logo = require('./config/logo.js');
colors.setTheme({
info: 'green',
data: 'white',
warn: 'yellow',
highlight: 'inverse',
debug: 'cyan',
error: 'red'
});
// -- Create Express instance and export
var app = express(),
env = app.settings.env,
// -- Import configuration
conf = require('./config/config.js'),
settings = conf.settings;
conf (app, express, env);
// -- Bootstrap Config
require('./bootstrap.js').boot(app);
// -- Routes
require('./config/routes.js')(app);
var server = http.createServer(app);
if(env == 'development'){
reload = require('reload');
reload(server,app,1500);
}
server.listen(settings.port, function(){
logo.long();
console.log(" Express server is listening on "+" port %d ".highlight.info + " in " + " %s mode ".highlight.data, settings.port, env);
if (env == 'development') {
notifier = new notifier();
notifier.notify({
title: pkg.name,
subtitle: 'v' + pkg.version,
message: 'Successfully started on port ' + settings.port
});
}
});