forked from MarquezProject/marquez
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setupProxy.js
26 lines (20 loc) · 696 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
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'
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(createProxyMiddleware('/api/v1', apiOptions))
router.get('/healthcheck', function (req, res) {
res.send('OK')
})
app.use(router)
app.listen(3000, function() {
console.log('App listening on port 3000!')
})