Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
wtf: rewrite
Maximilian Kaske4d26786351a5
diff --git a/apps/web/next.config.js b/apps/web/next.config.jsindex 10551d9a3..cd63d9df7 100644--- a/apps/web/next.config.js+++ b/apps/web/next.config.js@@ -98,14 +98,13 @@ const nextConfig = {source: "/:path*",has: [{ type: "cookie", key: "sp_mode", value: "new" },- { type: "cookie", key: "sp_slug", value: "<slug>" },{type: "host",value:"^(?!.*\\.openstatus\\.dev$)(?!openstatus\\.dev$)(?<domain>.+)$",},],- destination: "https://:slug.stpg.dev/:path*",+ destination: "https://www.stpg.dev/:domain/:path*",},],};diff --git a/apps/web/src/middleware.ts b/apps/web/src/middleware.tsindex dd80be013..910673dd2 100644--- a/apps/web/src/middleware.ts+++ b/apps/web/src/middleware.ts@@ -71,7 +71,6 @@ export default auth(async (req) => {const modeCookie = req.cookies.get("sp_mode")?.value; // "legacy" | "new"const cached = modeCookie === "legacy" || modeCookie === "new";let mode: "legacy" | "new" | undefined = cached ? modeCookie : undefined;- let slug: string | undefined = undefined;console.log({ mode, cached });@@ -83,11 +82,9 @@ export default auth(async (req) => {console.log({ cache });// Determine legacy flag from cachemode = cache ? "new" : "legacy";- slug = cache ? String(cache) : undefined;} catch (e) {console.error("error getting cache", e);mode = "legacy";- slug = undefined;}}@@ -103,9 +100,6 @@ export default auth(async (req) => {res.headers.set("x-proxy", "1");// Short-lived cookie so toggles apply relatively quicklyres.cookies.set("sp_mode", "new", { path: "/", maxAge: MAX_AGE });- if (slug) {- res.cookies.set("sp_slug", slug, { path: "/", maxAge: MAX_AGE });- }// If we just set the cookie, trigger one redirect so next.config.js// rewrites that depend on sp_mode can apply on the next request.if (!cached) {