Download src/server/routes-async.ts from bolikoto/zcode-api: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/src/server/routes-async.ts
- Command line
-
hf download hf://spaces/bolikoto/zcode-api/src/server/routes-async.ts
-
curl -L -o routes-async.ts https://huggingface.co/spaces/bolikoto/zcode-api/resolve/main/src/server/routes-async.ts
1.05 kB
| /** | |
| * Async (off-peak) route handlers — thin adapters from the HTTP layer to | |
| * `src/async/handler.ts`. Mirrors the `routes-responses.ts` pattern. | |
| * | |
| * Route registration lives in `server.ts:createFetchHandler` (gated by | |
| * `config.async.enabled`). Per-route Node socket timeout extension lives | |
| * in `server.ts:startServer` (24h for `/async/*`; default 600s elsewhere). | |
| */ | |
| import { | |
| handleAsyncMessages, | |
| handleAsyncChat, | |
| handleAsyncHealth, | |
| type AsyncHandlerOptions, | |
| } from "../async/handler.js"; | |
| export { handleAsyncMessages, handleAsyncChat, handleAsyncHealth, type AsyncHandlerOptions }; | |
| export async function handleAsyncMessagesRoute(req: Request, opts: AsyncHandlerOptions): Promise<Response> { | |
| return handleAsyncMessages(req, opts); | |
| } | |
| export async function handleAsyncChatRoute(req: Request, opts: AsyncHandlerOptions): Promise<Response> { | |
| return handleAsyncChat(req, opts); | |
| } | |
| export async function handleAsyncHealthRoute(req: Request, opts: AsyncHandlerOptions): Promise<Response> { | |
| return handleAsyncHealth(req, opts); | |
| } | |