Download src/start.ts from incname/web: direct link, hf CLI and curl.
- Browser
- Download file 739 Bytes
-
https://huggingface.co/spaces/incname/web/resolve/main/src/start.ts
- Command line
-
hf download hf://spaces/incname/web/src/start.ts
-
curl -L -o start.ts https://huggingface.co/spaces/incname/web/resolve/main/src/start.ts
739 Bytes
| import { createStart, createMiddleware } from "@tanstack/react-start"; | |
| import { renderErrorPage } from "./lib/error-page"; | |
| import { attachSupabaseAuth } from "@/integrations/supabase/auth-attacher"; | |
| 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(() => ({ | |
| functionMiddleware: [attachSupabaseAuth], | |
| requestMiddleware: [errorMiddleware], | |
| })); | |