-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathserver.js
28 lines (22 loc) · 2.07 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
const express = require("express");
const path = require("path");
const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
app.use(express.static(path.join(__dirname, 'build')));
app.post('/login', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true, secure: false }));
app.post('/pollIndexPage', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/pollEnv', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/pollL2Page', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/pollRouting', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/getDmvpn', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/getipsla', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/ribStatus', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/liveinterfaces', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/pollRouting', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/getDmvpn', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/getipsla', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/query', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.post('/apistatus', createProxyMiddleware({ target: 'https://127.0.0.1:5000', changeOrigin: true , secure: false }));
app.get('/*', function (req, res) {res.sendFile(path.join(__dirname, 'build', 'index.html'));});
const PORT = process.env.PORT || 3000;
app.listen(PORT, () => console.log(`Server started on port ${PORT}`));