mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-19 08:28:10 +02:00
Initial Commit 🚀 🚀
This commit is contained in:
commit
4f2a629340
444 changed files with 76863 additions and 0 deletions
14
ui/src/lib/apiClient.ts
Normal file
14
ui/src/lib/apiClient.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import type { CreateClientConfig } from '@/client/client.gen';
|
||||
|
||||
export const createClientConfig: CreateClientConfig = (config) => {
|
||||
// Use different URLs for server-side vs client-side
|
||||
const isServer = typeof window === 'undefined';
|
||||
const baseUrl = isServer
|
||||
? process.env.BACKEND_URL || process.env.NEXT_PUBLIC_BACKEND_URL
|
||||
: process.env.NEXT_PUBLIC_BACKEND_URL;
|
||||
|
||||
return {
|
||||
...config,
|
||||
baseUrl,
|
||||
};
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue