forked from rjmreis/hapi-api
-
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) · 668 Bytes
/
server.js
File metadata and controls
28 lines (24 loc) · 668 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
'use strict';
const Glue = require('glue');
const Hapi = require('hapi');
const manifest = require('./config/manifest.json');
if (!process.env.PRODUCTION) {
manifest.registrations.push({
"plugin": {
"register": "blipp",
"options": {}
}
});
let good = manifest.registrations.find(p => p.plugin.register === 'good');
if (good) {
good.plugin.options.reporters[0].events['ops'] = '*';
}
}
Glue.compose(manifest, { relativeTo: __dirname }, (err, server) => {
if (err) {
console.log('server.register err:', err);
}
server.start(() => {
console.log('✅ Server is listening on ' + server.info.uri.toLowerCase());
});
});