The serverless API for our final software engineering project.

12345678910111213
  1. // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
  2. import type { NextApiRequest, NextApiResponse } from "next";
  3. type Data = {
  4. name: string;
  5. };
  6. export default function handler(
  7. req: NextApiRequest,
  8. res: NextApiResponse<Data>
  9. ) {
  10. res.status(200).json({ name: "John Doe" });
  11. }