-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
56 lines (49 loc) · 956 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
45
46
47
48
49
50
51
52
53
54
55
56
'use strict';
const Hapi = require('hapi');
const server = new Hapi.Server();
server.connection({ host: 'localhost', port: 11001 });
server.register([
{
register: require('hapi-auth-jwt')
},
{
register: require('./lib/plugins/util')
},
{
register: require('./lib/plugins/database'),
options: {
mongo: {
uri: 'mongodb://localhost/crunchbase',
options: {
useMongoClient: true
}
}
}
},
{
register: require('./lib/modules/dbQuery')
},
{
register: require('./lib/modules/companies'),
options: {
baseUrl: '/v1/companies'
}
},
{
register: require('./lib/modules/authentication'),
options: {
baseUrl: '/v1/user'
}
}
], (err) => {
if (err) {
throw err;
}
server.start((err) => {
if (err) {
throw err;
}
server.log('info', `Server listening on ${server.info.uri}`);
});
});
module.exports = server;