-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (36 loc) · 810 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
var Hapi = require('Hapi');
var Joi = require('Joi');
var config = require('./config.js');
var bole = require('bole'),
pretty = require('bistre')(),
log = bole('server');
bole.output({
level: 'info',
stream: pretty
});
pretty.pipe(process.stdout);
var server = new Hapi.Server(8080, "localhost", config.server);
server.route({
path: '/favicon.ico',
method: 'GET',
handler: { file: './favicon.ico' }
});
server.route({
path: '/static/{path*}',
method: 'GET',
handler: {
directory: {
path: './static',
listing: false,
index: false
}
}
});
server.pack.register(
[{plugin: require('./facets/link')}],
function(err) {
if (err) throw err;
server.start(function() {
console.log("Hapi server started @ " + server.info.uri);
});
});