frontpage/pages/api/hello.ts

14 lines
309 B
TypeScript
Raw Normal View History

2021-11-30 23:48:54 +01:00
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2021-12-14 23:45:00 +01:00
import type { NextApiRequest, NextApiResponse } from "next";
2021-11-30 23:48:54 +01:00
type Data = {
name: string
}
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
2021-12-14 23:45:00 +01:00
res.status(200).json({ name: "John Doe" });
2021-11-30 23:48:54 +01:00
}