forked from vercel/next.js
/
index.js
42 lines (40 loc) · 1.03 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Link from 'next/link'
export default function Main({ message }) {
return (
<div>
<h1 className="title">Hello {message}</h1>
<ul>
<li>
<Link href="/stream-response">
<a>Stream a response</a>
</Link>
</li>
<li>
<Link href="/rewrite-me-to-about?message=refreshed">
<a id="link-with-rewritten-url" className={message}>
Rewrite me to about
</a>
</Link>
</li>
<li>
<Link href="/rewrite-me-to-vercel">
<a>Rewrite me to Vercel</a>
</Link>
</li>
<li>
<Link href="/redirect-me-to-about">
<a>redirect me to about</a>
</Link>
</li>
<li>
<Link href="/dynamic-routes/hello-world">
<a id="go-to-hello-world-anchor">Hello World</a>
</Link>
</li>
</ul>
</div>
)
}
export const getServerSideProps = ({ query }) => ({
props: { message: query.message || 'World' },
})