-
Notifications
You must be signed in to change notification settings - Fork 4
/
app.js
24 lines (20 loc) · 819 Bytes
/
app.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
const express = require('express');
const axios = require('axios');
const app = express();
app.use('/', express.static(__dirname + '/public'))
app.get('/events', function(req, res) {
console.log("nodejs: getting event data.");
// TODO replace with env variable
// var all_events = "http://accountroute-default.koyfman-oc4-f2c6cdc6801be85fd188b09d006f13e3-0000.us-south.containers.appdomain.cloud/loyalty/v1/events"
var all_events = "http://localhost:9080/loyalty/v1/events"
axios.get(all_events,{}).then(function(response){
return res.status(200).send(response.data);
}).catch(function(err) {
console.log(err);
return res.status(500);
});
});
let PORT = process.env.PORT || 8080
app.listen(PORT, function () {
console.log("Server started on port: " + PORT)
})