Files
JJ KasperandGitHub 9d22da476b Ensure trailing slash is handled correctly with middleware (#38282)
* Ensure trailing slash is handled correctly with middleware

* update source modifying

* undo extra change
2022-07-04 09:31:07 -05:00

24 lines
490 B
JavaScript

import { useRouter } from 'next/router'
export default function Page(props) {
const router = useRouter()
return (
<>
<p id="blog">/blog/[slug]</p>
<p id="query">{JSON.stringify(router.query)}</p>
<p id="pathname">{router.pathname}</p>
<p id="as-path">{router.asPath}</p>
<p id="props">{JSON.stringify(props)}</p>
</>
)
}
export function getServerSideProps({ params }) {
return {
props: {
now: Date.now(),
params,
},
}
}