2022-07-19 20:32:51 +00:00
|
|
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
2022-07-25 17:22:59 +00:00
|
|
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
2022-07-19 20:32:51 +00:00
|
|
|
|
|
|
|
type Data = {
|
2022-07-25 17:22:59 +00:00
|
|
|
name: string;
|
|
|
|
};
|
2022-07-19 20:32:51 +00:00
|
|
|
|
|
|
|
export default function handler(
|
2022-07-25 17:22:59 +00:00
|
|
|
req: NextApiRequest,
|
|
|
|
res: NextApiResponse<Data>
|
2022-07-19 20:32:51 +00:00
|
|
|
) {
|
2022-07-25 17:22:59 +00:00
|
|
|
res.status(200).json({ name: 'John Doe' });
|
2022-07-19 20:32:51 +00:00
|
|
|
}
|