generated from nholtware/service-template-express
14 lines
456 B
TypeScript
14 lines
456 B
TypeScript
import { Router } from "express";
|
|
import type { RuntimeConfig } from "../lib/runtime-config.js";
|
|
|
|
// Unauthenticated by design (LAN homelab). Runtime config holds no secrets
|
|
// by contract; see src/runtime-config.schema.ts.
|
|
export function adminRouter(deps: { runtimeConfig: RuntimeConfig }): Router {
|
|
const router = Router();
|
|
|
|
router.get("/admin/runtime-config", (_req, res) => {
|
|
res.json(deps.runtimeConfig.snapshot());
|
|
});
|
|
|
|
return router;
|
|
}
|