-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver.js
More file actions
40 lines (28 loc) · 708 Bytes
/
Copy pathserver.js
File metadata and controls
40 lines (28 loc) · 708 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
29
30
31
32
33
34
35
36
/**
* Created by manojmali1 on 10/06/17.
*/
'use strict'
const hapi = require('hapi')
const aerospike = require('aerospike')
const promise = require('bluebird')
const hapiSpike = require('./index')
const hosts = [{addr: 'aerospike-qa-1.crowdfireapp.com', port: 3000}]
const client = promise.promisifyAll(aerospike.client({
hosts: hosts,
policies: {
timeout: 10000
}
}))
const server = new hapi.Server()
server.connection({
port: 9090
})
hapiSpike.getAerospikeEndpoints(server, '', client)
client.connectAsync().then(function (res) {
//start the server
server.start(function () {
console.log('Hapi-spike: server started')
})
}).catch(function (err) {
console.log(err)
})