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:
Alex
2022-08-06 18:14:54 -05:00
committed by GitHub
parent cf2b9eddfa
commit b68358766b
23 changed files with 152 additions and 66 deletions

View File

@@ -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');