add health endpoint for healthchecks (#27)
This commit is contained in:
parent
f89f41380a
commit
d53d10b774
2 changed files with 14 additions and 0 deletions
12
src/routes/health.ts
Normal file
12
src/routes/health.ts
Normal file
|
@ -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;
|
|
@ -7,6 +7,7 @@ import youtubeApiPlayer from "./youtube_api_routes/player.ts";
|
||||||
import invidiousRouteLatestVersion from "./invidious_routes/latestVersion.ts";
|
import invidiousRouteLatestVersion from "./invidious_routes/latestVersion.ts";
|
||||||
import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts";
|
import invidiousRouteDashManifest from "./invidious_routes/dashManifest.ts";
|
||||||
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
import videoPlaybackProxy from "./videoPlaybackProxy.ts";
|
||||||
|
import health from "./health.ts";
|
||||||
|
|
||||||
export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) => {
|
export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) => {
|
||||||
app.use("*", logger());
|
app.use("*", logger());
|
||||||
|
@ -22,4 +23,5 @@ export const routes = (app: Hono, konfigStore: Store<Record<string, unknown>>) =
|
||||||
app.route("/latest_version", invidiousRouteLatestVersion);
|
app.route("/latest_version", invidiousRouteLatestVersion);
|
||||||
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
|
app.route("/api/manifest/dash/id", invidiousRouteDashManifest);
|
||||||
app.route("/videoplayback", videoPlaybackProxy);
|
app.route("/videoplayback", videoPlaybackProxy);
|
||||||
|
app.route("/healthz", health);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue