Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(studio): add /api/status-override endpoint for status page banner override (#43641)

Charis2541d58fb1e1
diff --git a/apps/studio/pages/api/status-override.ts b/apps/studio/pages/api/status-override.ts
new file mode 100644
index 00000000000..145cc1dd4e3
--- /dev/null
+++ b/apps/studio/pages/api/status-override.ts
@@ -0,0 +1,19 @@
+import { IS_PLATFORM } from 'common'
+import { NextApiRequest, NextApiResponse } from 'next'
+
+type ResponseData = { enabled: boolean }
+
+export default function handler(req: NextApiRequest, res: NextApiResponse<ResponseData>) {
+ if (!IS_PLATFORM) {
+ return res.status(404).end()
+ }
+
+ if (req.method !== 'GET') {
+ res.setHeader('Allow', ['GET'])
+ return res.status(405).end()
+ }
+
+ return res.status(200).json({
+ enabled: process.env.NEXT_PUBLIC_ONGOING_INCIDENT === 'true',
+ })
+}
diff --git a/apps/studio/proxy.ts b/apps/studio/proxy.ts
index d19ef58baf7..1b804831fb8 100644
--- a/apps/studio/proxy.ts
+++ b/apps/studio/proxy.ts
@@ -25,6 +25,7 @@ const HOSTED_SUPPORTED_API_URLS = [
'/edge-functions/body',
'/generate-attachment-url',
'/incident-status',
+ '/status-override',
'/api/integrations/stripe-sync',
'/content/graphql',
]