-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
28 lines (24 loc) · 675 Bytes
/
server.js
File metadata and controls
28 lines (24 loc) · 675 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
const Hapi = require('hapi');
const config = require('./server/config');
const server = new Hapi.Server(config.hapi.options);
server.connection({host: config.host, port: config.port});
const plugins = [
{
register: require('good'),
options: {
reporters: [
{
reporter: require('good-console'),
events: { log: '*', response: '*' }
}
]
}
},
{ register: require('./index') }
];
server.register(plugins, (err) => {
if (err) throw err;
server.start(() => {
console.log('Hapi server started @' + server.info.uri);
});
});