Skip to content

Commit

Permalink
fix: default settings (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos authored Dec 9, 2024
1 parent e85ae59 commit 750a4cc
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,11 @@ const env = import.meta.env as Record<string, string>
export default env

// The name of the current service.
export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "replace-me"

// If the current service the root service. This will only be true for portal.
export const SERVICE_IS_ROOT = Boolean(Number(env.VITE_SERVICE_IS_ROOT ?? "0"))

// The protocol, domain and port of the current service.
export const SERVICE_PROTOCOL = env.VITE_SERVICE_PROTOCOL ?? "http"
export const SERVICE_DOMAIN = env.VITE_SERVICE_DOMAIN ?? "localhost"
export const SERVICE_PORT = Number(env.VITE_SERVICE_PORT ?? "8000")

// The base url of the current service.
// The root service does not need its name included in the base url.
export const SERVICE_BASE_URL =
`${SERVICE_PROTOCOL}://${SERVICE_DOMAIN}:${SERVICE_PORT}` +
(SERVICE_IS_ROOT ? "" : `/${SERVICE_NAME}`)
export const SERVICE_NAME = env.VITE_SERVICE_NAME ?? "REPLACE_ME"

// The api url of the current service.
export const SERVICE_API_URL = `${SERVICE_BASE_URL}/api`
export const SERVICE_API_URL =
env.VITE_SERVICE_API_URL ?? "http://localhost:8000"

// The names of cookies.
export const CSRF_COOKIE_NAME = `${SERVICE_NAME}_csrftoken`
Expand Down

0 comments on commit 750a4cc

Please sign in to comment.