-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathserver.js
36 lines (35 loc) · 973 Bytes
/
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
29
30
31
32
33
34
35
36
const express = require('express');
const proxy = require('http-proxy-middleware');
const path = require('path');
const port = process.env.PORT || 8080;
const app = express();
app.use(express.static(path.join(__dirname, 'public')));
app.use('/gnib-proxy', proxy({
pathRewrite: {
'^/gnib-proxy/': '/'
},
target: 'https://burghquayregistrationoffice.inis.gov.ie',
secure: false,
changeOrigin: true,
headers: {
referer: 'https://burghquayregistrationoffice.inis.gov.ie/Website/AMSREG/AMSRegWeb.nsf/AppSelect?OpenForm'
}
}));
app.use('/inis-proxy', proxy({
pathRewrite: {
'^/inis-proxy/': '/'
},
target: 'http://www.inis.gov.ie',
secure: false,
changeOrigin: true
}));
app.use('/notification-proxy', proxy({
pathRewrite: {
'^/notification-proxy/': '/'
},
target: 'http://localhost:1338',
secure: false,
changeOrigin: true
}));
app.listen(port);
console.log('Server started');