aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/api/hello.ts
diff options
context:
space:
mode:
authorAlberto-Duarte <alberto@albertoduarte.com>2023-04-21 13:51:46 +0100
committerAlberto-Duarte <alberto@albertoduarte.com>2023-04-21 13:51:46 +0100
commit1b3a300173c4531bebf3b88966a1fec64d276440 (patch)
tree6c8f9f0a745eadd3615a50bbf47e14d1233cb80c /src/pages/api/hello.ts
First commit
Diffstat (limited to 'src/pages/api/hello.ts')
-rw-r--r--src/pages/api/hello.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pages/api/hello.ts b/src/pages/api/hello.ts
new file mode 100644
index 0000000..f8bcc7e
--- /dev/null
+++ b/src/pages/api/hello.ts
@@ -0,0 +1,13 @@
+// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
+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' })
+}