feat: add SPA, serve at /app/, update Dockerfile and README
- React + TanStack Router + shadcn/ui SPA under spa/ - serve spa/dist at /app/ with index.html fallback for client routing - Dockerfile: node build stage for SPA, copy dist into runtime image - README: document SPA, CORS_ORIGINS env var, architecture entry - vite base set to /app/, manifest.json paths fixed
This commit is contained in:
17
spa/src/lib/query-client.ts
Normal file
17
spa/src/lib/query-client.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { QueryClient } from "@tanstack/react-query"
|
||||
import { ApiError } from "@/lib/api/client"
|
||||
|
||||
export const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
staleTime: 60_000,
|
||||
gcTime: 5 * 60_000,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnReconnect: false,
|
||||
retry: (failureCount, error) => {
|
||||
if (error instanceof ApiError && error.status < 500) return false
|
||||
return failureCount < 2
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user