mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
18 lines
348 B
JavaScript
18 lines
348 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export async function getServerSideProps({ req }) {
|
|
return { props: { url: req.url } }
|
|
}
|
|
|
|
export default function RewriteTarget({ url }) {
|
|
const router = useRouter()
|
|
|
|
return (
|
|
<>
|
|
<h1>rewrite-target</h1>
|
|
<p id="as-path">{router.asPath}</p>
|
|
<p id="req-url">{url}</p>
|
|
</>
|
|
)
|
|
}
|