-
Notifications
You must be signed in to change notification settings - Fork 0
/
application.js
70 lines (52 loc) · 1.15 KB
/
application.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
'use strict';
const express = require('express');
// Constants
const PORT = 8081;
const HOST = '0.0.0.0';
// App
const app = express();
app.get('/', (req, res) => {
res.send('Hello world\n');
});
app.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
/* const probe = require('probe-mon')
const express = require('express')
const {
getipsdata,
} = require('./micros/ips/ips')
const {
getipspps
} = require('./micros/ips/ips-pps')
const {
gettoken,
validaterequest,
encrypt
} = require('./middlewares/auth')
const app = express()
app.use(probe())
//app.all('/api/ips/*', [validaterequest])
app.get('/api/ips/pps/:refineryid', getipspps)
app.get('/api/ips/cps/:refineryid', getipsdata)
app.get('/ipstoken', gettoken)
app.get('/', (req, res, next) => {
res.send('Service is active')
})
app.use((req, res, next) => {
res.send({
status: 404,
errormessage: 'Not Found',
data: []
})
})
const server = app.listen(8081, function () {
var port = server.address().port;
console.log('Starting server at port %s', port)
})
module.exports = Object.assign({}, {
server,
getipsdata,
getipspps,
gettoken,
app
}) */