diff options
| author | Dhravya <[email protected]> | 2024-02-23 16:04:49 -0700 |
|---|---|---|
| committer | Dhravya <[email protected]> | 2024-02-23 16:04:49 -0700 |
| commit | aa1b57bbcd99da4c6d68c145f7c07ea7bd35c8dc (patch) | |
| tree | f5ab247b154a21bbebbe56cca0d7f3397219b7c3 /apps/anycontext-front/src/app/api/hello/route.ts | |
| parent | hide bun lockfile (diff) | |
| download | supermemory-aa1b57bbcd99da4c6d68c145f7c07ea7bd35c8dc.tar.xz supermemory-aa1b57bbcd99da4c6d68c145f7c07ea7bd35c8dc.zip | |
chaos
Diffstat (limited to 'apps/anycontext-front/src/app/api/hello/route.ts')
| -rw-r--r-- | apps/anycontext-front/src/app/api/hello/route.ts | 22 |
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) +} |