Skip to content

Commit

Permalink
add health endpoint for healthchecks (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fijxu authored Dec 25, 2024
1 parent f89f413 commit d53d10b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/routes/health.ts
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 2 additions & 0 deletions src/routes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Record<string, unknown>>) => {
app.use("*", logger());
Expand All @@ -22,4 +23,5 @@ export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) =
app.route("/latest_version", invidiousRouteLatestVersion);
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
app.route("/videoplayback", videoPlaybackProxy);
app.route("/healthz", health);
};

0 comments on commit d53d10b

Please sign in to comment.