From 9a11e746e7215468d5be555192eab4d292915686 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Fri, 4 Oct 2024 21:43:03 +0100 Subject: [PATCH] Add docker healthcheck route --- pages/api/healthcheck.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 pages/api/healthcheck.ts diff --git a/pages/api/healthcheck.ts b/pages/api/healthcheck.ts new file mode 100644 index 0000000..bc9033f --- /dev/null +++ b/pages/api/healthcheck.ts @@ -0,0 +1,30 @@ +import { NextApiRequest, NextApiResponse } from "next"; + +/** + * ============================================================================== + * Imports + * ============================================================================== + */ + +/** ****************************************************************************** */ +/** ****************************************************************************** */ +/** ****************************************************************************** */ +/** ****************************************************************************** */ +/** ****************************************************************************** */ +/** ****************************************************************************** */ + +/** + * API handler + * ============================================================================== + * @type {import("next").NextApiHandler} + */ +export default async function handler( + req: NextApiRequest, + res: NextApiResponse +) { + if (req.method !== "GET") return res.json({ msg: "Failed!" }); + + res.json({ + success: true, + }); +}