Skip to content

Commit 02d1658

Browse files
committed
Move to /
1 parent b4d996b commit 02d1658

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

web/pages/home.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@ import {PageBase} from 'web/components/page-base'
22
import {Col} from 'web/components/layout/col'
33
import {LoggedOutHome} from "web/components/home/home";
44

5-
export const TEST_DOWNTIME = true
6-
7-
export async function getServerSideProps() {
8-
if (TEST_DOWNTIME) {
9-
// This will cause Next.js to return a 500 *at runtime*
10-
throw new Error('500 - Test downtime');
11-
}
12-
13-
return { props: {} };
14-
}
15-
165
export default function Home() {
176
return (
187
<PageBase trackPageView={'home'}>

web/pages/index.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@ import {useUser} from 'web/hooks/use-user'
44
import {LoggedOutHome} from "web/components/home/home";
55
import {ProfilesHome} from "web/components/profiles/profiles-home";
66

7+
export const TEST_DOWNTIME = true
78

9+
// To simulate downtime, you need the error to happen at runtime, not at build time.
10+
// That means the page must be server-rendered, not statically generated.
11+
export async function getServerSideProps() {
12+
if (TEST_DOWNTIME) {
13+
// This will cause Next.js to return a 500 *at runtime*
14+
throw new Error('500 - Test downtime');
15+
}
16+
17+
return { props: {} };
18+
}
819

920
export default function ProfilesPage() {
1021
const user = useUser();

0 commit comments

Comments
 (0)