@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 04:45 UTC

main
ts 24 lines 973 Bytes
Raw
1 /**
2 * `@alchemy.run/frontend-frameworks/astro/entrypoints/node-server` — the
3 * Node container server entrypoint the Node deploy target pins as the
4 * adapter's `serverEntrypoint`.
5 *
6 * Compiled by astro's `ssr` environment build (the `astro/app/entrypoint`
7 * virtual modules only resolve there), it builds the production `App` from
8 * the serialized manifest and exports a web-standard fetch `handler`. The
9 * target's finishing pass wraps this handler in a Node HTTP program that
10 * serves `clientDirectory` first, then falls through here.
11 */
12 import { createApp } from "astro/app/entrypoint";
13 import { setGetEnv } from "astro/env/setup";
14
15 // astro:env `getSecret` reads process.env on the Node runtime.
16 setGetEnv((key) => process.env[key]);
17
18 const app = createApp();
19
20 export const handler = (request: Request) =>
21 app.render(request, {
22 addCookieHeader: true,
23 clientAddress: request.headers.get("x-forwarded-for")?.split(",")[0]?.trim() || undefined,
24 });