2022-02-22 06:14:12 +00:00
|
|
|
import type { NextApiRequest, NextApiResponse } from 'next';
|
2022-02-22 05:36:06 +00:00
|
|
|
|
|
|
|
|
export async function handler(req: NextApiRequest, res: NextApiResponse) {
|
2022-02-22 06:14:12 +00:00
|
|
|
if (req.method === 'POST') {
|
|
|
|
|
res.status(200).json({ name: 'John Doe' });
|
2022-02-22 05:36:06 +00:00
|
|
|
} else {
|
|
|
|
|
res.status(405).send(`Method ${req.method} Not Allowed`);
|
|
|
|
|
}
|
|
|
|
|
}
|