diff --git a/src/routes/health.ts b/src/routes/health.ts new file mode 100644 index 0000000..517a991 --- /dev/null +++ b/src/routes/health.ts @@ -0,0 +1,12 @@ +import { Hono } from "hono"; + +const health = new Hono(); + +health.get("/", () => { + return new Response("OK", { + status: 200, + headers: { "Content-Type": "text/plain" }, + }); +}); + +export default health; \ No newline at end of file diff --git a/src/routes/index.ts b/src/routes/index.ts index e481268..5ad9258 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -7,6 +7,7 @@ import youtubeApiPlayer from "./youtube_api_routes/player.ts"; import invidiousRouteLatestVersion from "./invidious_routes/latestVersion.ts"; import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts"; import videoPlaybackProxy from "./videoPlaybackProxy.ts"; +import health from "./health.ts"; export const routes = (app: Hono, konfigStore: Store>) => { app.use("*", logger()); @@ -22,4 +23,5 @@ export const routes = (app: Hono, konfigStore: Store>) = app.route("/latest_version", invidiousRouteLatestVersion); app.route("/api/manifest/dash/id", invidiousRouteDashManifest); app.route("/videoplayback", videoPlaybackProxy); + app.route("/healthz", health); };