-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathserver.js
51 lines (46 loc) · 1.01 KB
/
server.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
var path = require('path');
var config = require(path.join(__dirname, 'config.js'));
var Hapi = require('hapi');
var server = new Hapi.Server();
server.connection({
port: parseInt(process.env.PORT, 10) || 3000,
host: 'localhost'
});
// Export the server to be required elsewhere.
module.exports = server;
server.register([
{
register: require("good"),
options: {
opsInterval: 5000,
reporters: [{
reporter: require('good-console'),
events: {
response: '*',
log: '*'
}
}]
}
},
{
register: require('./models')
},
{
register: require('./server/base/index.js')
},
{
register: require('./server/base/messages/index.js')
},
{
register: require('./server/base/users/index.js')
},
{
register: require('./server/socket/index.js')
}
], function() {
server.start(function() {
console.log('Server started at: ' + server.info.uri);
});
});
// Export the server to be required elsewhere.
module.exports = server;