next.js/test/integration/fetch-polyfill-ky-universal/pages/static.js
static.js16 lines320 B
import ky from 'ky-universal'

export default function StaticPage({ data }) {
  return <div>{data.foo}</div>
}

export async function getStaticProps() {
  const port = process.env.NEXT_PUBLIC_API_PORT
  const json = await ky.get(`http://localhost:${port}/`).json()
  return {
    props: {
      data: json,
    },
  }
}
Quest for Codev2.0.0
/
SIGN IN