We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c46f29 commit 9242eafCopy full SHA for 9242eaf
exercises/user_signup/solutions/codely_next-typescript-middle-out/src/pages/api/signup.ts
@@ -0,0 +1,15 @@
1
+import { NextApiRequest, NextApiResponse } from "next/types";
2
+
3
+export default async (request: NextApiRequest, httpResponse: NextApiResponse): Promise<void> => {
4
+ if (request.method !== "POST") {
5
+ httpResponse.status(404).end();
6
7
+ return;
8
+ };
9
10
+ if (request.body.name.length < 2) {
11
+ httpResponse.status(403).end();
12
+ }
13
14
+ httpResponse.status(200).end();
15
+}
0 commit comments