chronograf/ui/parcel.js

24 lines
547 B
JavaScript
Raw Normal View History

2018-06-29 23:08:14 +00:00
const proxy = require('http-proxy-middleware')
const Bundler = require('parcel')
const express = require('express')
2018-07-25 18:08:09 +00:00
const port = Number(process.env.PORT || 8080)
2018-06-29 23:08:14 +00:00
console.log(`Serving on http://localhost:${port}`) // eslint-disable-line no-console
const app = express()
const bundler = new Bundler(['src/index.html', 'src/worker/worker.ts'], {
2018-06-29 23:08:14 +00:00
outDir: './build/',
})
app.use(
proxy('/chronograf/v1', {
target: 'http://localhost:8888',
logLevel: 'warn',
changeOrigin: true,
})
)
app.use(bundler.middleware())
app.listen(port)