diff --git a/next.config.js b/next.config.js index 14b6e1f..113fd61 100644 --- a/next.config.js +++ b/next.config.js @@ -10,4 +10,12 @@ const withPlugins = require("next-compose-plugins") module.exports = withPlugins([[withBundleAnalyzer]], { reactStrictMode: true, experimental: { instrumentationHook: true }, + rewrites() { + return [ + { source: "/healthz", destination: "/api/health" }, + { source: "/api/healthz", destination: "/api/health" }, + { source: "/health", destination: "/api/health" }, + { source: "/ping", destination: "/api/health" }, + ] + }, }) diff --git a/pages/api/health.ts b/pages/api/health.ts new file mode 100644 index 0000000..05fda7d --- /dev/null +++ b/pages/api/health.ts @@ -0,0 +1,5 @@ +import { NextApiRequest, NextApiResponse } from "next" + +export default function handler(req: NextApiRequest, res: NextApiResponse) { + res.status(200).json({ status: "ok" }) +}