comicbox/pages/api/hello.ts

14 lines
319 B
TypeScript
Raw Normal View History

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