Created
September 20, 2022 06:08
-
-
Save brandonchadlange/136dadf095dd214f689f0fe9d49f8f40 to your computer and use it in GitHub Desktop.
Next.js API route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { NextApiRequest, NextApiResponse } from 'next' | |
type Data = { | |
name: string | |
} | |
export default function handler( | |
req: NextApiRequest, | |
res: NextApiResponse<Data> | |
) { | |
res.status(200).json({ name: 'John Doe' }) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment