Skip to content

Commit c19a4c3

Browse files
committed
config fixes
1 parent b3de9cc commit c19a4c3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/app/catalog/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ export default async function CatalogPage() {
3838
version: it?.server?.version ?? undefined,
3939
}));
4040
serversSummary = { count: items.length, titles, sample };
41-
} catch {
42-
// Leave serversSummary at its default empty state
41+
} catch (error) {
42+
// Log the error for debugging
43+
console.error("[catalog] Failed to fetch servers:", error);
4344
}
4445

4546
return (

src/generated/client.gen.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,13 @@ export type CreateClientConfig<T extends ClientOptions = ClientOptions2> = (
2020
override?: Config<ClientOptions & T>,
2121
) => Config<Required<ClientOptions> & T>;
2222

23-
export const client = createClient(createConfig<ClientOptions2>());
23+
// Configure client with baseUrl for both SSR and client-side
24+
// In development: points to standalone MSW mock server (http://localhost:9090)
25+
// In production: points to real backend API
26+
const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:9090";
27+
28+
export const client = createClient(
29+
createConfig<ClientOptions2>({
30+
baseUrl,
31+
}),
32+
);

0 commit comments

Comments
 (0)