2021-12-01 04:20:13 +00:00
|
|
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
2021-12-02 23:49:46 +00:00
|
|
|
import type { NextApiRequest, NextApiResponse } from 'next'
|
2021-12-01 04:20:13 +00:00
|
|
|
|
|
|
|
type Data = {
|
2021-12-02 23:49:46 +00:00
|
|
|
name: string
|
|
|
|
}
|
2021-12-01 04:20:13 +00:00
|
|
|
|
|
|
|
export default function handler(
|
|
|
|
req: NextApiRequest,
|
|
|
|
res: NextApiResponse<Data>
|
|
|
|
) {
|
2021-12-02 23:49:46 +00:00
|
|
|
res.status(200).json({ name: 'John Doe' })
|
2021-12-01 04:20:13 +00:00
|
|
|
}
|