I'm trying to add a new set of SSR pages alongside the SSG pages provided by the starter. From a fresh starter install, a basic example is to add test/index.js to pages.
// test/index.js
const Test = ({ data }) => {
return (
<div>
<pre>{JSON.stringify(data, null, 2)}</pre>
</div>
)
}
export async function getServerSideProps() {
const res = await fetch(`http://localhost:1337/pages/1`)
const data = await res.json()
return { props: { data } }
}
export default Test
Then configure a button to /test url. This will result in a 404 error. In development you can refresh to see the desired page at /test or directly navigate to the page. When deployed /test is always 404. I don't know if this is a Next.js issue or if has to do with how the starter is configured. Any help would be greatly appreciated. Thank you
I'm trying to add a new set of SSR pages alongside the SSG pages provided by the starter. From a fresh starter install, a basic example is to add
test/index.js
to pages.Then configure a button to
/test
url. This will result in a 404 error. In development you can refresh to see the desired page at/test
or directly navigate to the page. When deployed/test
is always 404. I don't know if this is a Next.js issue or if has to do with how the starter is configured. Any help would be greatly appreciated. Thank you