mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 17:23:21 +03:00
feat(.well-known): add .well-known/immich to reference API endpoint (#1308)
* feat(.well-known): add .well-known/immich to reference API endpoint
* feat(.well-known): make schema optional (defaults to https)
* adjust method comment to be a little less confusing
* fix casting issue with resovled url
* include when checking Well-known, update server hint
* add validation for login form's server url
* consolidate common process into resolveAndSetEndpoint
* fix missed prettier formatting
* revert translation changes
* update environment variable description, hopefully a bit clearer
* rename environment variable to IMMICH_API_URL_EXTERNAL
* comment out optional env variables
* fix(web): browser-side api client to include authorization token
* Revert "fix(web): browser-side api client to include authorization token"
This reverts commit 60e338938f.
* remove multi-domain related changes
This commit is contained in:
@@ -56,7 +56,10 @@ class ImmichApi {
|
||||
}
|
||||
}
|
||||
|
||||
// Browser side (public) API client
|
||||
export 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);
|
||||
|
||||
12
web/src/routes/.well-known/immich/+server.ts
Normal file
12
web/src/routes/.well-known/immich/+server.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { env } from '$env/dynamic/public';
|
||||
import { json } from '@sveltejs/kit';
|
||||
|
||||
const endpoint = env.PUBLIC_IMMICH_API_URL_EXTERNAL || '/api';
|
||||
|
||||
export const GET = async () => {
|
||||
return json({
|
||||
api: {
|
||||
endpoint
|
||||
}
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user