generated from nholtware/service-template-express
Initial commit
This commit is contained in:
commit
a0c3aa640c
36 changed files with 7676 additions and 0 deletions
14
src/routes/admin.ts
Normal file
14
src/routes/admin.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue