-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
48 lines (40 loc) · 1.34 KB
/
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const express = require("express");
const bodyParser = require("body-parser");
const app = express();
const http = require('request');
const databaseQuery = require('./routes/databasequery')
const podStatus = require('./routes/kubernetes/kub');
const sequenceDiagram = require('./routes/kubernetes/kubesequence');
const yaml = require('./routes/yaml');
const mayaVolume = require('./routes/mayaapiserver/listvolume');
const litmusChaos = require('./routes/litmuschaos/inducechaos');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use((req, res, next) => {
res.setHeader("Access-control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-Width, Content-Type, Accept");
res.setHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, OPTIONS");
next();
});
var options = {
url: 'https://api.github.com/users/inyee786',
method: 'GET',
headers: {
'User-Agent': 'request'
}
};
http.get(options, function (err, resp, body) {
if (err) {
console.log(err);
} else {
data = JSON.parse(body);
console.log(data);
}
});
app.use('/person',databaseQuery);
app.use('/pod',podStatus)
app.use('/pods',sequenceDiagram)
app.use('/workloads',yaml);
app.use('/openebs',mayaVolume);
app.use('/litmus',litmusChaos);
module.exports = app;