forked from new-davinci/mbot-soccer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (28 loc) · 833 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
'use strict';
const Hapi = require('hapi');
const env = require('./config/environment');
const pkg = require('./package.json');
const routes = require('./routes');
const _ = require('lodash');
const server = new Hapi.Server();
server.connection({ port: env.get('port') });
server.register([
require('inert'),
require('./plugins/controls')
], (err) => {
if (err) {
console.log('Error loading plugins', err);
throw err;
}
server.route(routes);
server.start((err) => {
if (err) {
console.log(err);
throw err;
}
console.log('=> Registered plugins:', { plugins: _.keysIn(server.registrations).join(', ') });
console.log('=> Booting server');
console.log('=> %s v%s running on %s', pkg.name, pkg.version, server.info.uri);
console.log('=> Ctrl-C to shutdown server');
});
});