feat: publish videoplayback proxy location on /info
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m17s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m17s
This commit is contained in:
parent
9ff358c364
commit
9512877ff2
2 changed files with 24 additions and 0 deletions
|
@ -9,6 +9,7 @@ import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts";
|
|||
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
||||
import metrics from "metrics";
|
||||
import health from "./health.ts";
|
||||
import info from "./info.ts"
|
||||
|
||||
export const routes = (
|
||||
app: Hono,
|
||||
|
@ -30,4 +31,6 @@ export const routes = (
|
|||
app.route("/videoplayback", videoPlaybackProxy);
|
||||
app.route("/metrics", metrics);
|
||||
app.route("/healthz", health);
|
||||
|
||||
app.route("/info", info);
|
||||
};
|
||||
|
|
21
src/routes/info.ts
Normal file
21
src/routes/info.ts
Normal file
|
@ -0,0 +1,21 @@
|
|||
import { Hono } from "hono";
|
||||
|
||||
const info = new Hono();
|
||||
|
||||
info.get("/", (c) => {
|
||||
const konfigStore = c.get("konfigStore");
|
||||
|
||||
const json = {
|
||||
"external_videoplayback_proxy":
|
||||
Deno.env.get("EXTERNAL_VIDEOPLAYBACK_PROXY") ||
|
||||
konfigStore.get(
|
||||
"networking.external_videoplayback_proxy",
|
||||
) as string,
|
||||
};
|
||||
return new Response(JSON.stringify(json), {
|
||||
status: 200,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
});
|
||||
});
|
||||
|
||||
export default info;
|
Reference in a new issue