constants.ts 789 B

123456789101112131415161718192021
  1. import { browser } from '$app/environment';
  2. import { PUBLIC_API_BASE_URL } from '$env/static/public';
  3. export const API_BASE_URL =
  4. PUBLIC_API_BASE_URL === ''
  5. ? browser
  6. ? `http://${location.hostname}:11434/api`
  7. : `http://localhost:11434/api`
  8. : PUBLIC_API_BASE_URL;
  9. export const WEB_UI_VERSION = 'v1.0.0-alpha.6';
  10. // Source: https://kit.svelte.dev/docs/modules#$env-static-public
  11. // This feature, akin to $env/static/private, exclusively incorporates environment variables
  12. // that are prefixed with config.kit.env.publicPrefix (usually set to PUBLIC_).
  13. // Consequently, these variables can be securely exposed to client-side code.
  14. // Example of the .env configuration:
  15. // OLLAMA_API_BASE_URL="http://localhost:11434/api"
  16. // # Public
  17. // PUBLIC_API_BASE_URL=$OLLAMA_API_BASE_URL