mirror of
https://github.com/immich-app/immich.git
synced 2025-11-08 19:12:32 +09:00
Remove VITE_SERVER_ENDPOINT dependency (#428)
* Move backend api to its own instance * Remove external fetch hook * Added endpoint for album * Added endpoint for admin page * Make request directly to immich-server * Refactor unsued code
This commit is contained in:
@@ -16,7 +16,7 @@ class ImmichApi {
|
||||
public authenticationApi: AuthenticationApi;
|
||||
public deviceInfoApi: DeviceInfoApi;
|
||||
public serverInfoApi: ServerInfoApi;
|
||||
private config = new Configuration({ basePath: serverEndpoint });
|
||||
private config = new Configuration({ basePath: '/api' });
|
||||
|
||||
constructor() {
|
||||
this.userApi = new UserApi(this.config);
|
||||
@@ -34,6 +34,12 @@ class ImmichApi {
|
||||
public removeAccessToken() {
|
||||
this.config.accessToken = undefined;
|
||||
}
|
||||
|
||||
public setBaseUrl(baseUrl: string) {
|
||||
this.config.basePath = baseUrl;
|
||||
}
|
||||
}
|
||||
|
||||
export const api = new ImmichApi();
|
||||
export const serverApi = new ImmichApi();
|
||||
serverApi.setBaseUrl('http://immich-server:3001');
|
||||
|
||||
Reference in New Issue
Block a user