Skip to content

Open-source status page, incident response and uptime monitoring

Revert "feat: nerd mode (#1375)" (#1378)

Maximilian Kaskeed3a8152517e
diff --git a/apps/dashboard/next-env.d.ts b/apps/dashboard/next-env.d.ts
index 830fb594c..1b3be0840 100644
--- a/apps/dashboard/next-env.d.ts
+++ b/apps/dashboard/next-env.d.ts
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
-/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/status-page/next-env.d.ts b/apps/status-page/next-env.d.ts
index 830fb594c..1b3be0840 100644
--- a/apps/status-page/next-env.d.ts
+++ b/apps/status-page/next-env.d.ts
@@ -1,6 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
-/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
diff --git a/apps/status-page/public/fonts/CommitMono-400-Italic.otf b/apps/status-page/public/fonts/CommitMono-400-Italic.otf
deleted file mode 100644
index 616bb0797..000000000
Binary files a/apps/status-page/public/fonts/CommitMono-400-Italic.otf and /dev/null differ
diff --git a/apps/status-page/public/fonts/CommitMono-400-Regular.otf b/apps/status-page/public/fonts/CommitMono-400-Regular.otf
deleted file mode 100644
index 4c029ed36..000000000
Binary files a/apps/status-page/public/fonts/CommitMono-400-Regular.otf and /dev/null differ
diff --git a/apps/status-page/public/fonts/CommitMono-700-Italic.otf b/apps/status-page/public/fonts/CommitMono-700-Italic.otf
deleted file mode 100644
index e948f7396..000000000
Binary files a/apps/status-page/public/fonts/CommitMono-700-Italic.otf and /dev/null differ
diff --git a/apps/status-page/public/fonts/CommitMono-700-Regular.otf b/apps/status-page/public/fonts/CommitMono-700-Regular.otf
deleted file mode 100644
index da3e6243f..000000000
Binary files a/apps/status-page/public/fonts/CommitMono-700-Regular.otf and /dev/null differ
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
index 4a46fc22b..0d09eb5d1 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/events/(list)/page.tsx
@@ -21,7 +21,7 @@ import {
import { Badge } from "@/components/ui/badge";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { formatDate } from "@/lib/formatter";
-import { Check } from "lucide-react";
+import { CircleCheck } from "lucide-react";
import Link from "next/link";
// TODO: include ?filter=maintenance/reports
@@ -71,11 +71,7 @@ export default function Page() {
<StatusEventTitle className="inline-flex gap-1">
{report.title}
{isReportResolvedOnly ? (
- <div className="mt-1 ml-1.5">
- <div className="rounded-full border border-success/20 bg-success/10 p-0.5 text-success">
- <Check className="size-3 shrink-0" />
- </div>
- </div>
+ <CircleCheck className="size-4 text-success shrink-0 mt-1 ml-1.5" />
) : null}
</StatusEventTitle>
{report.monitorsToStatusReports.length > 0 ? (
diff --git a/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx b/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
index a54352d26..63505cfa1 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/(public)/page.tsx
@@ -12,10 +12,7 @@ import {
StatusBanner,
StatusBannerContainer,
StatusBannerContent,
- StatusBannerTabs,
- StatusBannerTabsContent,
- StatusBannerTabsList,
- StatusBannerTabsTrigger,
+ StatusBannerTitle,
} from "@/components/status-page/status-banner";
import {
StatusEventTimelineMaintenance,
@@ -25,8 +22,8 @@ import { StatusFeed } from "@/components/status-page/status-feed";
import { StatusMonitor } from "@/components/status-page/status-monitor";
import { Separator } from "@/components/ui/separator";
import { useTRPC } from "@/lib/trpc/client";
-import { cn } from "@/lib/utils";
import { useQuery } from "@tanstack/react-query";
+import Link from "next/link";
import { useParams } from "next/navigation";
export default function Page() {
@@ -58,72 +55,55 @@ export default function Page() {
</StatusHeader>
{page.openEvents.length > 0 ? (
<StatusContent>
- <StatusBannerTabs
- defaultValue={`${page.openEvents[0].type}-${page.openEvents[0].id}`}
- >
- <StatusBannerTabsList>
- {page.openEvents.map((e, i) => {
- return (
- <StatusBannerTabsTrigger
- value={`${e.type}-${e.id}`}
- status={e.status}
- key={e.id}
- className={cn(
- i === 0 && "rounded-tl-lg",
- i === page.openEvents.length - 1 && "rounded-tr-lg",
- )}
- >
- {e.name}
- </StatusBannerTabsTrigger>
- );
- })}
- </StatusBannerTabsList>
- {page.openEvents.map((e) => {
- if (e.type === "report") {
- const report = page.statusReports.find(
- (report) => report.id === e.id,
- );
- if (!report) return null;
- return (
- <StatusBannerTabsContent
- value={`${e.type}-${e.id}`}
- key={e.id}
- >
- <StatusBannerContainer status={e.status}>
- <StatusBannerContent>
- <StatusEventTimelineReport
- updates={report.statusReportUpdates}
- withDot={false}
- />
- </StatusBannerContent>
- </StatusBannerContainer>
- </StatusBannerTabsContent>
- );
- }
- if (e.type === "maintenance") {
- const maintenance = page.maintenances.find(
- (maintenance) => maintenance.id === e.id,
- );
- if (!maintenance) return null;
- return (
- <StatusBannerTabsContent
- value={`${e.type}-${e.id}`}
- key={e.id}
- >
- <StatusBannerContainer status={e.status}>
- <StatusBannerContent>
- <StatusEventTimelineMaintenance
- maintenance={maintenance}
- withDot={false}
- />
- </StatusBannerContent>
- </StatusBannerContainer>
- </StatusBannerTabsContent>
- );
- }
- return null;
- })}
- </StatusBannerTabs>
+ {page.openEvents.map((e) => {
+ if (e.type === "maintenance") {
+ const maintenance = page.maintenances.find(
+ (maintenance) => maintenance.id === e.id,
+ );
+ if (!maintenance) return null;
+ return (
+ <Link
+ href={`./events/maintenance/${e.id}`}
+ key={e.id}
+ className="rounded-lg"
+ >
+ <StatusBannerContainer status={e.status}>
+ <StatusBannerTitle>{e.name}</StatusBannerTitle>
+ <StatusBannerContent>
+ <StatusEventTimelineMaintenance
+ maintenance={maintenance}
+ withDot={false}
+ />
+ </StatusBannerContent>
+ </StatusBannerContainer>
+ </Link>
+ );
+ }
+ if (e.type === "report") {
+ const report = page.statusReports.find(
+ (report) => report.id === e.id,
+ );
+ if (!report) return null;
+ return (
+ <Link
+ href={`./events/report/${e.id}`}
+ key={e.id}
+ className="rounded-lg"
+ >
+ <StatusBannerContainer status={e.status}>
+ <StatusBannerTitle>{e.name}</StatusBannerTitle>
+ <StatusBannerContent>
+ <StatusEventTimelineReport
+ updates={report.statusReportUpdates}
+ withDot={false}
+ />
+ </StatusBannerContent>
+ </StatusBannerContainer>
+ </Link>
+ );
+ }
+ return null;
+ })}
</StatusContent>
) : (
<StatusBanner status={page.status} />
diff --git a/apps/status-page/src/app/(status-page)/[domain]/layout.tsx b/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
index 9f5ae61e8..8415013aa 100644
--- a/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
+++ b/apps/status-page/src/app/(status-page)/[domain]/layout.tsx
@@ -19,7 +19,7 @@ export const schema = z.object({
const DISPLAY_FLOATING_BUTTON =
process.env.NODE_ENV === "development" ||
- process.env.NEXT_PUBLIC_ENABLE_FLOATING_BUTTON === "true";
+ process.env.ENABLE_FLOATING_BUTTON === "true";
export default async function Layout({
children,
diff --git a/apps/status-page/src/app/globals.css b/apps/status-page/src/app/globals.css
index dbc1a4e15..8711e0f91 100644
--- a/apps/status-page/src/app/globals.css
+++ b/apps/status-page/src/app/globals.css
@@ -14,7 +14,7 @@
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
- --font-mono: var(--font-commit-mono, var(--font-geist-mono));
+ --font-mono: var(--font-geist-mono);
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -55,8 +55,7 @@
}
:root {
- /* --radius: 0.625rem; */
- --radius: 0px;
+ --radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
@@ -176,10 +175,3 @@
@apply bg-background text-foreground;
}
}
-
-@layer utilities {
- /* NOTE: allows us to --radius: 0px and avoid rounding issues - otherwise it is 'infinite * 1px' */
- .rounded-full {
- border-radius: calc(var(--radius) * 99999999);
- }
-}
diff --git a/apps/status-page/src/app/layout.tsx b/apps/status-page/src/app/layout.tsx
index 5eaad0aaf..beb3bc68f 100644
--- a/apps/status-page/src/app/layout.tsx
+++ b/apps/status-page/src/app/layout.tsx
@@ -24,32 +24,6 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});
-const commitMono = LocalFont({
- src: [
- {
- path: "../../public/fonts/CommitMono-400-Regular.otf",
- weight: "400",
- style: "normal",
- },
- {
- path: "../../public/fonts/CommitMono-400-Italic.otf",
- weight: "400",
- style: "italic",
- },
- {
- path: "../../public/fonts/CommitMono-700-Regular.otf",
- weight: "700",
- style: "normal",
- },
- {
- path: "../../public/fonts/CommitMono-700-Italic.otf",
- weight: "700",
- style: "italic",
- },
- ],
- variable: "--font-commit-mono",
-});
-
export const metadata: Metadata = {
...defaultMetadata,
twitter: {
@@ -74,7 +48,6 @@ export default function RootLayout({
geistSans.variable,
geistMono.variable,
cal.variable,
- commitMono.variable,
"antialiased",
)}
>
diff --git a/apps/status-page/src/components/nav/footer.tsx b/apps/status-page/src/components/nav/footer.tsx
index 31a8ab54b..f0b04ea8d 100644
--- a/apps/status-page/src/components/nav/footer.tsx
+++ b/apps/status-page/src/components/nav/footer.tsx
@@ -20,9 +20,9 @@ export function Footer(props: React.ComponentProps<"footer">) {
return (
<footer {...props}>
<div className="mx-auto flex max-w-2xl items-center justify-between gap-4 px-3 py-2">
- <div>
- <p className="font-mono text-muted-foreground text-sm leading-none">
- powered by <Link href="#">openstatus</Link>
+ <div className="leading-[0.9]">
+ <p className="text-muted-foreground text-sm">
+ Powered by <Link href="#">OpenStatus</Link>
</p>
<TimestampHoverCard date={new Date(dataUpdatedAt)} side="top">
<span className="text-muted-foreground/70 text-xs">
diff --git a/apps/status-page/src/components/status-page/floating-button.tsx b/apps/status-page/src/components/status-page/floating-button.tsx
index 771793e79..80f5d17a0 100644
--- a/apps/status-page/src/components/status-page/floating-button.tsx
+++ b/apps/status-page/src/components/status-page/floating-button.tsx
@@ -154,7 +154,7 @@ export function FloatingButton({ className }: { className?: string }) {
<Button
size="icon"
variant="outline"
- className="size-12 rounded-full dark:bg-background"
+ className="size-12 rounded-full"
>
<Settings className="size-5" />
<span className="sr-only">Open status page settings</span>
diff --git a/apps/status-page/src/components/status-page/status-banner.tsx b/apps/status-page/src/components/status-page/status-banner.tsx
index 2d9772cfd..a3c56be12 100644
--- a/apps/status-page/src/components/status-page/status-banner.tsx
+++ b/apps/status-page/src/components/status-page/status-banner.tsx
@@ -1,4 +1,3 @@
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { cn } from "@/lib/utils";
import {
AlertCircleIcon,
@@ -49,10 +48,10 @@ export function StatusBannerContainer({
data-status={status}
className={cn(
"group/status-banner overflow-hidden rounded-lg border",
- "data-[status=success]:border-success data-[status=success]:bg-success/5 dark:data-[status=success]:bg-success/10",
- "data-[status=degraded]:border-warning data-[status=degraded]:bg-warning/5 dark:data-[status=degraded]:bg-warning/10",
- "data-[status=error]:border-destructive data-[status=error]:bg-destructive/5 dark:data-[status=error]:bg-destructive/10",
- "data-[status=info]:border-info data-[status=info]:bg-info/5 dark:data-[status=info]:bg-info/10",
+ "data-[status=success]:border-success",
+ "data-[status=degraded]:border-warning",
+ "data-[status=error]:border-destructive",
+ "data-[status=info]:border-info",
className,
)}
>
@@ -91,7 +90,7 @@ export function StatusBannerTitle({
return (
<div
className={cn(
- "px-3 py-2 font-medium text-background",
+ "px-3 py-2 font-medium text-background sm:px-4 sm:py-3",
"group-data-[status=success]/status-banner:bg-success",
"group-data-[status=degraded]/status-banner:bg-warning",
"group-data-[status=error]/status-banner:bg-destructive",
@@ -140,96 +139,3 @@ export function StatusBannerIcon({
</div>
);
}
-
-// Tabs Components
-
-export function StatusBannerTabs({
- className,
- children,
- status,
- ...props
-}: React.ComponentProps<typeof Tabs> & {
- status?: "success" | "degraded" | "error" | "info";
-}) {
- return (
- <Tabs
- data-slot="status-banner-tabs"
- data-status={status}
- className={cn(
- "gap-0",
- "data-[status=success]:bg-success/20",
- "data-[status=degraded]:bg-warning/20",
- "data-[status=error]:bg-destructive/20",
- "data-[status=info]:bg-info/20",
- className,
- )}
- {...props}
- >
- {children}
- </Tabs>
- );
-}
-
-export function StatusBannerTabsList({
- className,
- children,
- ...props
-}: React.ComponentProps<typeof TabsList>) {
- return (
- <div className={cn("rounded-t-lg", "w-full overflow-x-auto")}>
- <TabsList
- className={cn(
- "rounded-none rounded-t-lg p-0",
- "border-none",
- className,
- )}
- {...props}
- >
- {children}
- </TabsList>
- </div>
- );
-}
-
-export function StatusBannerTabsTrigger({
- className,
- children,
- status,
- ...props
-}: React.ComponentProps<typeof TabsTrigger> & {
- status?: "success" | "degraded" | "error" | "info";
-}) {
- return (
- <TabsTrigger
- data-slot="status-banner-tabs-trigger"
- data-status={status}
- className={cn(
- "font-mono",
- "rounded-none border-none focus-visible:ring-inset",
- "h-full text-foreground data-[state=active]:text-background dark:text-foreground dark:data-[state=active]:text-background",
- "data-[state=active]:data-[status=success]:bg-success data-[status=success]:bg-success/50 dark:data-[state=active]:data-[status=success]:bg-success dark:data-[status=success]:bg-success/50",
- "data-[state=active]:data-[status=degraded]:bg-warning data-[status=degraded]:bg-warning/50 dark:data-[state=active]:data-[status=degraded]:bg-warning dark:data-[status=degraded]:bg-warning/50",
- "data-[state=active]:data-[status=error]:bg-destructive data-[status=error]:bg-destructive/50 dark:data-[state=active]:data-[status=error]:bg-destructive dark:data-[status=error]:bg-destructive/50",
- "data-[state=active]:data-[status=info]:bg-info data-[status=info]:bg-info/50 dark:data-[state=active]:data-[status=info]:bg-info dark:data-[status=info]:bg-info/50",
- "data-[state=active]:shadow-none",
- className,
- )}
- {...props}
- >
- {children}
- </TabsTrigger>
- );
-}
-
-// NOTE: tabing into content is not being highlighted
-export function StatusBannerTabsContent({
- className,
- children,
- ...props
-}: React.ComponentProps<typeof TabsContent>) {
- return (
- <TabsContent className={cn("-mx-3", className)} {...props}>
- {children}
- </TabsContent>
- );
-}
diff --git a/apps/status-page/src/components/status-page/status-events.tsx b/apps/status-page/src/components/status-page/status-events.tsx
index b10d2e790..f574aa0e0 100644
--- a/apps/status-page/src/components/status-page/status-events.tsx
+++ b/apps/status-page/src/components/status-page/status-events.tsx
@@ -124,7 +124,6 @@ export function StatusEventTimelineReport({
}
withSeparator={index !== updates.length - 1}
withDot={withDot}
- isLast={index === updates.length - 1}
/>
))}
</div>
@@ -136,7 +135,6 @@ function StatusEventTimelineReportUpdate({
duration,
withSeparator = true,
withDot = true,
- isLast = false,
}: {
report: {
date: Date;
@@ -146,7 +144,6 @@ function StatusEventTimelineReportUpdate({
withSeparator?: boolean;
duration?: string;
withDot?: boolean;
- isLast?: boolean;
}) {
return (
<div data-variant={report.status} className="group">
@@ -160,7 +157,7 @@ function StatusEventTimelineReportUpdate({
{withSeparator ? <StatusEventTimelineSeparator /> : null}
</div>
) : null}
- <div className={cn(isLast ? "mb-0" : "mb-2")}>
+ <div className="mb-2">
<StatusEventTimelineTitle>
<span>{status[report.status]}</span>{" "}
{/* underline decoration-dashed underline-offset-2 decoration-muted-foreground/30 */}
@@ -212,8 +209,7 @@ export function StatusEventTimelineMaintenance({
</div>
</div>
) : null}
- {/* NOTE: is always last, no need for className="mb-2" */}
- <div>
+ <div className="mb-2">
<StatusEventTimelineTitle>
<span>Maintenance</span>{" "}
<span className="font-mono text-muted-foreground/70 text-xs">
@@ -263,10 +259,7 @@ export function StatusEventTimelineMessage({
...props
}: React.ComponentProps<"div">) {
return (
- <div
- className={cn("font-mono text-muted-foreground text-sm", className)}
- {...props}
- >
+ <div className={cn("text-muted-foreground text-sm", className)} {...props}>
{children}
</div>
);
diff --git a/apps/status-page/src/components/status-page/status-feed.tsx b/apps/status-page/src/components/status-page/status-feed.tsx
index 2dc23ffd5..2eb3fe2d1 100644
--- a/apps/status-page/src/components/status-page/status-feed.tsx
+++ b/apps/status-page/src/components/status-page/status-feed.tsx
@@ -82,7 +82,7 @@ export function StatusFeed({
return (
<StatusEmptyState>
<Newspaper className="size-4 text-muted-foreground" />
- <StatusEmptyStateTitle>No recent notifications</StatusEmptyStateTitle>
+ <StatusEmptyStateTitle>No recent reports</StatusEmptyStateTitle>
<StatusEmptyStateDescription>
There have been no reports within the last 7 days.
</StatusEmptyStateDescription>
diff --git a/apps/status-page/src/components/status-page/status-monitor.tsx b/apps/status-page/src/components/status-page/status-monitor.tsx
index 4dd2cbe4f..899a67d3f 100644
--- a/apps/status-page/src/components/status-page/status-monitor.tsx
+++ b/apps/status-page/src/components/status-page/status-monitor.tsx
@@ -56,7 +56,7 @@ export function StatusMonitor({
{...props}
>
<div className="flex flex-row items-center justify-between gap-4">
- <div className="flex flex-row min-w-0 items-center gap-2">
+ <div className="flex flex-row items-center gap-2">
<StatusMonitorTitle>{monitor.name}</StatusMonitorTitle>
<StatusMonitorDescription>
{monitor.description}
@@ -90,13 +90,7 @@ export function StatusMonitorTitle({
...props
}: React.ComponentProps<"div">) {
return (
- <div
- className={cn(
- "flex-1 truncate font-medium font-mono text-foreground leading-none",
- className,
- )}
- {...props}
- >
+ <div className={cn("font-medium", className)} {...props}>
{children}
</div>
);
@@ -140,7 +134,7 @@ export function StatusMonitorIcon({
return (
<div
className={cn(
- "flex size-[12.5px] items-center justify-center rounded-full bg-muted text-background [&>svg]:size-[9px]",
+ "flex size-4 items-center justify-center rounded-full bg-muted text-background [&>svg]:size-2.5",
"group-data-[variant=success]/monitor:bg-success",
"group-data-[variant=degraded]/monitor:bg-warning",
"group-data-[variant=error]/monitor:bg-destructive",
@@ -165,7 +159,7 @@ export function StatusMonitorFooter({
isLoading?: boolean;
}) {
return (
- <div className="flex flex-row items-center justify-between font-mono text-muted-foreground text-xs">
+ <div className="flex flex-row items-center justify-between text-muted-foreground text-xs">
<div>
{isLoading ? (
<Skeleton className="h-4 w-18" />
@@ -191,7 +185,7 @@ export function StatusMonitorUptime({
return (
<div
{...props}
- className={cn("font-mono text-foreground text-sm leading-non", className)}
+ className={cn("font-mono text-muted-foreground text-sm", className)}
>
{children}
</div>
@@ -212,7 +206,6 @@ export function StatusMonitorStatus({
return (
<div
className={cn(
- "font-mono",
"group-data-[variant=success]/monitor:text-success",
"group-data-[variant=degraded]/monitor:text-warning",
"group-data-[variant=error]/monitor:text-destructive",
diff --git a/apps/status-page/src/components/status-page/status-tracker.tsx b/apps/status-page/src/components/status-page/status-tracker.tsx
index f32bbb16a..8116d7457 100644
--- a/apps/status-page/src/components/status-page/status-tracker.tsx
+++ b/apps/status-page/src/components/status-page/status-tracker.tsx
@@ -189,7 +189,7 @@ export function StatusTracker({ data }: { data: UptimeData }) {
<HoverCardTrigger asChild>
<div
className={cn(
- "group relative flex h-full w-full cursor-pointer flex-col px-px outline-none first:pl-0 last:pr-0 hover:opacity-80 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 data-[aria-pressed=true]:opacity-80",
+ "group relative flex h-full w-full cursor-pointer flex-col px-px outline-none hover:opacity-80 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 data-[aria-pressed=true]:opacity-80",
)}
onClick={() => handleBarClick(index)}
onFocus={() => handleBarFocus(index)}
diff --git a/apps/status-page/src/components/status-page/status.tsx b/apps/status-page/src/components/status-page/status.tsx
index eb0d85017..524906920 100644
--- a/apps/status-page/src/components/status-page/status.tsx
+++ b/apps/status-page/src/components/status-page/status.tsx
@@ -181,10 +181,7 @@ export function StatusEmptyStateDescription({
...props
}: React.ComponentProps<"div">) {
return (
- <div
- className={cn("font-mono text-muted-foreground text-sm", className)}
- {...props}
- >
+ <div className={cn("text-muted-foreground text-sm", className)} {...props}>
{children}
</div>
);
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index aa1f7f798..62a6d84de 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -45,6 +45,7 @@ const nextConfig = {
async headers() {
return [{ source: "/(.*)", headers: securityHeaders }];
},
+ trailingSlash: true,
async redirects() {
return [
{
@@ -65,9 +66,6 @@ const nextConfig = {
];
},
async rewrites() {
- const HOST =
- process.env.NODE_ENV === "development" ? "localhost:3001" : "stpg.dev";
- const PROTOCOL = process.env.NODE_ENV === "development" ? "http" : "https";
return {
beforeFiles: [
// Proxy app subdomain to /app
@@ -81,21 +79,9 @@ const nextConfig = {
],
destination: "/app/:path*",
},
- // New design: proxy Next.js assets from external host when cookie indicates "new"
- {
- source: "/_next/:path*",
- has: [
- { type: "cookie", key: "sp_mode", value: "new" },
- {
- type: "host",
- value: "(?<slug>[^.]+)\\.(openstatus\\.dev|localhost)",
- },
- ],
- destination: `${PROTOCOL}://${HOST}/_next/:path*`,
- },
// New design: proxy app routes to external host with slug prefix
{
- source: "/:path((?!_next/).*)",
+ source: "/:path*",
has: [
{ type: "cookie", key: "sp_mode", value: "new" },
{
@@ -103,8 +89,7 @@ const nextConfig = {
value: "(?<slug>[^.]+)\\.(openstatus\\.dev|localhost)",
},
],
- // NOTE: might be different on prod and localhost (without :slug)
- destination: `${PROTOCOL}://${HOST}/:slug/:path*`,
+ destination: "https://:slug.stpg.dev/:path*",
},
],
};