diff --git a/apps/builder/next.config.mjs b/apps/builder/next.config.mjs index bbe2629d7..fc03207d5 100644 --- a/apps/builder/next.config.mjs +++ b/apps/builder/next.config.mjs @@ -81,8 +81,17 @@ const nextConfig = { (process.env.NEXT_PUBLIC_POSTHOG_HOST ?? 'https://app.posthog.com') + '/:path*', }, + { + source: '/healthz', + destination: '/api/health', + }, + ] + : [ + { + source: '/healthz', + destination: '/api/health', + }, ] - : [] }, } diff --git a/apps/builder/src/pages/api/health.ts b/apps/builder/src/pages/api/health.ts new file mode 100644 index 000000000..1d6ae21e4 --- /dev/null +++ b/apps/builder/src/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', timestamp: new Date().toISOString() }) +} diff --git a/apps/viewer/next.config.mjs b/apps/viewer/next.config.mjs index 70ad531bd..6aa219fae 100644 --- a/apps/viewer/next.config.mjs +++ b/apps/viewer/next.config.mjs @@ -159,6 +159,10 @@ const nextConfig = { destination: '/api/v1/typebots/:typebotId/blocks/:blockId/storage/upload-url', }, + { + source: '/healthz', + destination: '/api/health', + }, ]) .concat( process.env.NEXTAUTH_URL diff --git a/apps/viewer/src/pages/api/health.ts b/apps/viewer/src/pages/api/health.ts new file mode 100644 index 000000000..1d6ae21e4 --- /dev/null +++ b/apps/viewer/src/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', timestamp: new Date().toISOString() }) +} diff --git a/ee/apps/landing-page/next.config.mjs b/ee/apps/landing-page/next.config.mjs index 8823b0250..77cf62431 100644 --- a/ee/apps/landing-page/next.config.mjs +++ b/ee/apps/landing-page/next.config.mjs @@ -25,6 +25,14 @@ const nextConfig = { }, ] }, + async rewrites() { + return [ + { + source: '/healthz', + destination: '/api/health', + }, + ] + }, } export default nextConfig diff --git a/ee/apps/landing-page/pages/api/health.ts b/ee/apps/landing-page/pages/api/health.ts new file mode 100644 index 000000000..1d6ae21e4 --- /dev/null +++ b/ee/apps/landing-page/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', timestamp: new Date().toISOString() }) +}