chore: setup google & kube z-pages health endpoint
This commit is contained in:
parent
bd0886a9b3
commit
9b477aaf92
2 changed files with 13 additions and 0 deletions
|
|
@ -10,4 +10,12 @@ const withPlugins = require("next-compose-plugins")
|
||||||
module.exports = withPlugins([[withBundleAnalyzer]], {
|
module.exports = withPlugins([[withBundleAnalyzer]], {
|
||||||
reactStrictMode: true,
|
reactStrictMode: true,
|
||||||
experimental: { instrumentationHook: 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" },
|
||||||
|
]
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
5
pages/api/health.ts
Normal file
5
pages/api/health.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import { NextApiRequest, NextApiResponse } from "next"
|
||||||
|
|
||||||
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
|
res.status(200).json({ status: "ok" })
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue