Skip to content

Commit

Permalink
chore: update api route
Browse files Browse the repository at this point in the history
  • Loading branch information
bluenex committed May 12, 2024
1 parent 9a22120 commit d8db98d
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pages/api/hello.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { NextApiRequest } from "next";

type Data = {
name: string;
};
export default function handler(req: NextApiRequest) {
if (req.method !== "GET") {
return new Response("Method Not Allowed", { status: 405 });
}

export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>,
) {
res.status(200).json({ name: "John Doe" });
return new Response(JSON.stringify({ message: "hello world!" }));
}

export const runtime = "edge";

0 comments on commit d8db98d

Please sign in to comment.