rsnext/test/integration/fetch-polyfill/pages/static.js
2020-04-30 16:35:48 +02:00

14 lines
312 B
JavaScript

export default function StaticPage({ data }) {
return <div>{data.foo}</div>
}
export async function getStaticProps() {
const port = process.env.NEXT_PUBLIC_API_PORT
const res = await fetch(`http://localhost:${port}/`)
const json = await res.json()
return {
props: {
data: json,
},
}
}