-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
35 lines (29 loc) · 680 Bytes
/
server.js
File metadata and controls
35 lines (29 loc) · 680 Bytes
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
import Hapi from 'hapi';
import good from 'good';
import goodConsole from 'good-console';
import config from './src/config';
import app from './index';
const server = new Hapi.Server(config.hapi.options);
server.connection({
host: config.host, port: config.port,
routes: { state: { parse: false, failAction: 'ignore' } }
});
const plugins = [
{
register: good,
options: {
reporters: {
console: [ {
module: 'good-console'
}, 'stdout' ]
}
}
},
{ register: app }
];
server.register(plugins, (err) => {
if (err) throw err;
server.start(() => {
console.log('Hapi server started @' + server.info.uri);
});
});