aboutsummaryrefslogtreecommitdiffstats
path: root/pages/api
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-06-29 21:11:25 +0300
committerJan Tuomi <jans.tuomi@gmail.com>2021-06-29 21:11:25 +0300
commitac31a7d9d43d3dcaa37906569dcb8eaf8429b3bf (patch)
treebfeb5d9326bcace756457f6a5a7513ec4a783709 /pages/api
Initial commit
Diffstat (limited to 'pages/api')
-rw-r--r--pages/api/hello.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/pages/api/hello.ts b/pages/api/hello.ts
new file mode 100644
index 0000000..f8bcc7e
--- /dev/null
+++ b/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' })
+}