Skip to content

Commit f646397

Browse files
committed
chore: update fixtures
1 parent 3fe1311 commit f646397

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

demos/canary/middleware.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { NextResponse } from 'next/server'
66
* @returns {NextResponse | undefined}
77
*/
88
export function middleware(request) {
9+
if (request.nextUrl.pathname === '/exists-but-not-routed') {
10+
return NextResponse.rewrite(new URL('/dashboard', request.url))
11+
}
12+
913
if (request.nextUrl.pathname === '/middleware-to-dashboard') {
1014
return NextResponse.rewrite(new URL('/dashboard', request.url))
1115
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export async function getServerSideProps() {
2+
return {
3+
props: {
4+
message: 'Hello World!',
5+
},
6+
}
7+
}
8+
9+
export default function Page({ message }) {
10+
return (
11+
<>
12+
<p>hello from exists but not routed {message}</p>
13+
</>
14+
)
15+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Link from 'next/link'
2+
3+
export default function Page(props) {
4+
return (
5+
<>
6+
<Link href="/exists-but-not-routed">
7+
<a id="link-to-rewritten-path">Exists but not routed</a>
8+
</Link>
9+
</>
10+
)
11+
}

0 commit comments

Comments
 (0)