mirror of
https://github.com/recklessop/zroc.git
synced 2026-07-03 21:33:13 -04:00
0500ac171c
- 61 files across zroc-ui/ and zroc-ova/ directories - Full content written for: config, auth, API layers, CSS, build files, OVA scripts, backend routes, charts, hooks, constants - Stubs in place for: page components, Sidebar, TopBar, docker-compose, authentik client, blueprint YAML, packer HCL, workflows, setup wizard Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
663 B
JavaScript
27 lines
663 B
JavaScript
// backend/routes/prometheus.js
|
|
'use strict';
|
|
|
|
const express = require('express');
|
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
|
const config = require('../config');
|
|
const { authenticate } = require('../middleware/authenticate');
|
|
|
|
const router = express.Router();
|
|
|
|
router.use(authenticate);
|
|
|
|
const prometheusProxy = createProxyMiddleware({
|
|
target: config.prometheus_url,
|
|
changeOrigin: true,
|
|
pathRewrite: { '^/api/prometheus': '' },
|
|
on: {
|
|
error: (err, req, res) => {
|
|
res.status(502).json({ error: 'Prometheus unreachable', detail: err.message });
|
|
},
|
|
},
|
|
});
|
|
|
|
router.use('/', prometheusProxy);
|
|
|
|
module.exports = router;
|