el.xwx.moe/pages/api/hello.ts

14 lines
276 B
TypeScript
Raw Normal View History

2023-01-31 05:36:56 -06:00
import type { NextApiRequest, NextApiResponse } from "next";
2023-01-29 12:12:36 -06:00
type Data = {
2023-01-31 05:36:56 -06:00
name: string;
};
2023-01-29 12:12:36 -06:00
2023-01-31 05:36:56 -06:00
export default async function handler(
2023-01-29 12:12:36 -06:00
req: NextApiRequest,
res: NextApiResponse<Data>
) {
2023-01-31 05:36:56 -06:00
console.log("Triggered hello.ts");
res.status(200).json({ name: "John Doe" });
2023-01-29 12:12:36 -06:00
}