next.js/test/integration/fetch-polyfill/pages/static.js
static.js15 lines312 B
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,
    },
  }
}
Quest for Codev2.0.0
/
SIGN IN