aboutsummaryrefslogtreecommitdiff
path: root/apps/anycontext-front/src/app/api/hello
diff options
context:
space:
mode:
Diffstat (limited to 'apps/anycontext-front/src/app/api/hello')
-rw-r--r--apps/anycontext-front/src/app/api/hello/route.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/anycontext-front/src/app/api/hello/route.ts b/apps/anycontext-front/src/app/api/hello/route.ts
new file mode 100644
index 00000000..705b3cb8
--- /dev/null
+++ b/apps/anycontext-front/src/app/api/hello/route.ts
@@ -0,0 +1,22 @@
+import type { NextRequest } from 'next/server'
+import { getRequestContext } from '@cloudflare/next-on-pages'
+
+export const runtime = 'edge'
+
+export async function GET(request: NextRequest) {
+ let responseText = 'Hello World'
+
+ // In the edge runtime you can use Bindings that are available in your application
+ // (for more details see:
+ // - https://developers.cloudflare.com/pages/framework-guides/deploy-a-nextjs-site/#use-bindings-in-your-nextjs-application
+ // - https://developers.cloudflare.com/pages/functions/bindings/
+ // )
+ //
+ // KV Example:
+ // const myKv = getRequestContext().env.MY_KV
+ // await myKv.put('suffix', ' from a KV store!')
+ // const suffix = await myKv.get('suffix')
+ // responseText += suffix
+
+ return new Response(responseText)
+}