-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
47 lines (42 loc) · 1.09 KB
/
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
46
47
'use strict';
var glue = require('glue');
var path = require('path');
var config = require('./config');
var url = require('url');
var manifest = {
connections : [{
port : config.port,
host : config.url && url.parse(config.url).host,
uri : config.url,
address : '0.0.0.0',
routes : {
files : {
relativeTo : __dirname
}
}
}],
registrations : [{
plugin : { register : 'inert' }
}, {
plugin : { register : 'vision' }
}, {
plugin : {
register : 'hapi-router',
options : {
cwd : __dirname,
routes : 'routes/**/*.route.js'
}
}
}]
};
glue.compose(manifest, { relativeTo: __dirname }, function(error, server) {
if (error) throw error;
server.views({
engines : { ejs: require('ejs') },
relativeTo : __dirname,
path : 'views'
});
server.start(function() {
console.info('Server running at %s', server.info.uri);
});
});