All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m4s
56 lines
1.6 KiB
Diff
56 lines
1.6 KiB
Diff
From 9316c695cb8dfa7bbeff988dbf75d3645d7fe766 Mon Sep 17 00:00:00 2001
|
|
From: Fijxu <fijxu@nadeko.net>
|
|
Date: Mon, 24 Mar 2025 18:52:53 -0300
|
|
Subject: [PATCH 2/7] feat: report the external videoplayback proxy via /info
|
|
endpoint
|
|
|
|
---
|
|
src/routes/index.ts | 2 ++
|
|
src/routes/info.ts | 17 +++++++++++++++++
|
|
2 files changed, 19 insertions(+)
|
|
create mode 100644 src/routes/info.ts
|
|
|
|
diff --git a/src/routes/index.ts b/src/routes/index.ts
|
|
index e67b618..6448e3d 100644
|
|
--- a/src/routes/index.ts
|
|
+++ b/src/routes/index.ts
|
|
@@ -10,6 +10,7 @@ import getDownloadHandler from "./invidious_routes/download.ts";
|
|
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
|
import health from "./health.ts";
|
|
import type { Config } from "../lib/helpers/config.ts";
|
|
+import info from "./info.ts";
|
|
|
|
export const routes = (
|
|
app: Hono,
|
|
@@ -32,4 +33,5 @@ export const routes = (
|
|
app.route("/api/v1/captions", invidiousCaptionsApi);
|
|
app.route("/videoplayback", videoPlaybackProxy);
|
|
app.route("/healthz", health);
|
|
+ app.route("/info", info);
|
|
};
|
|
diff --git a/src/routes/info.ts b/src/routes/info.ts
|
|
new file mode 100644
|
|
index 0000000..423c297
|
|
--- /dev/null
|
|
+++ b/src/routes/info.ts
|
|
@@ -0,0 +1,17 @@
|
|
+import { Hono } from "hono";
|
|
+
|
|
+const info = new Hono();
|
|
+
|
|
+info.get("/", (c) => {
|
|
+ const config = c.get("config")
|
|
+
|
|
+ const json = {
|
|
+ "external_videoplayback_proxy": config.networking.external_videoplayback_proxy
|
|
+ };
|
|
+ return new Response(JSON.stringify(json), {
|
|
+ status: 200,
|
|
+ headers: { "Content-Type": "application/json" },
|
|
+ });
|
|
+});
|
|
+
|
|
+export default info;
|
|
--
|
|
2.49.0
|
|
|