📜  下一个 api typescript 代码示例

📅  最后修改于: 2022-03-11 14:48:15.657000             🧑  作者: Mango

代码示例1
import type { NextApiRequest, NextApiResponse } from 'next'

type Data = {
  name: string
}

export default (req: NextApiRequest, res: NextApiResponse) => {
  res.status(200).json({ name: 'John Doe' })
}