Post.getInitialProps = async function (context) {
  const { id } = context.query
  const res = await fetch(`http://api.tvmaze.com/shows/${id}`)
  const show = await res.json()

  console.log(`Fetched show: ${show.name}`)

  return { show }
}

  

相关文章:

  • 2021-03-26
  • 2021-06-05
  • 2021-07-19
  • 2022-01-15
  • 2021-10-02
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2021-07-12
  • 2022-12-23
  • 2021-11-28
  • 2021-12-05
  • 2021-12-18
相关资源
相似解决方案