Spaces:
Build error
Build error
Download src/start.ts from launch-calcium/Grabber-In-Tanstack-LlmDesk: direct link, hf CLI and curl.
- Browser
- Download file 619 Bytes
-
https://huggingface.co/spaces/launch-calcium/Grabber-In-Tanstack-LlmDesk/resolve/main/src/start.ts
- Command line
-
hf download hf://spaces/launch-calcium/Grabber-In-Tanstack-LlmDesk/src/start.ts
-
curl -L -o start.ts https://huggingface.co/spaces/launch-calcium/Grabber-In-Tanstack-LlmDesk/resolve/main/src/start.ts
619 Bytes
| import { createStart, createMiddleware } from "@tanstack/react-start"; | |
| import { renderErrorPage } from "./lib/error-page"; | |
| const errorMiddleware = createMiddleware().server(async ({ next }) => { | |
| try { | |
| return await next(); | |
| } catch (error) { | |
| if (error != null && typeof error === "object" && "statusCode" in error) { | |
| throw error; | |
| } | |
| console.error(error); | |
| return new Response(renderErrorPage(), { | |
| status: 500, | |
| headers: { "content-type": "text/html; charset=utf-8" }, | |
| }); | |
| } | |
| }); | |
| export const startInstance = createStart(() => ({ | |
| requestMiddleware: [errorMiddleware], | |
| })); | |