-
Notifications
You must be signed in to change notification settings - Fork 300
/
setupProxy.js
29 lines (22 loc) · 807 Bytes
/
setupProxy.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
const { createProxyMiddleware } = require('http-proxy-middleware');
const express = require('express')
const router = express.Router()
const apiOptions = {
target: `http:https://${process.env.MARQUEZ_HOST}:${process.env.MARQUEZ_PORT}/`
}
const app = express()
const path = __dirname + '/dist'
const port = process.env.WEB_PORT
app.use('/', express.static(path))
app.use('/datasets', express.static(path))
app.use('/events', express.static(path))
app.use('/lineage/:type/:namespace/:name', express.static(path))
app.use('/datasets/column-level/:namespace/:name', express.static(path))
app.use(createProxyMiddleware('/api/v1', apiOptions))
router.get('/healthcheck', function (req, res) {
res.send('OK')
})
app.use(router)
app.listen(port, function() {
console.log(`App listening on port ${port}!`)
})