mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): combine api and serverApi (#1833)
This commit is contained in:
parent
10cb612fb1
commit
5c86e13239
13 changed files with 32 additions and 31 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import { browser } from '$app/environment';
|
||||
import { env } from '$env/dynamic/public';
|
||||
import {
|
||||
AlbumApi,
|
||||
|
|
@ -56,10 +57,11 @@ class ImmichApi {
|
|||
}
|
||||
}
|
||||
|
||||
// Browser side (public) API client
|
||||
export const api = new ImmichApi();
|
||||
const api = new ImmichApi();
|
||||
|
||||
// Server side API client
|
||||
export const serverApi = new ImmichApi();
|
||||
const immich_server_url = env.PUBLIC_IMMICH_SERVER_URL || 'http://immich-server:3001';
|
||||
serverApi.setBaseUrl(immich_server_url);
|
||||
if (!browser) {
|
||||
const serverUrl = env.PUBLIC_IMMICH_SERVER_URL || 'http://immich-server:3001';
|
||||
api.setBaseUrl(serverUrl);
|
||||
}
|
||||
|
||||
export { api };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue