template: tanstack_start_ts_current-6b12e5d4b74e

This commit is contained in:
Lovable
2026-07-21 15:07:15 +02:00
commit d319ad429c
73 changed files with 6531 additions and 0 deletions

22
src/start.ts Normal file
View File

@@ -0,0 +1,22 @@
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],
}));