basic tempate of web
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import { stripTrailingSlash } from "@/utils/strip-trailing-slash"
|
||||
|
||||
export const ENVIRONMENT = import.meta.env.MODE
|
||||
|
||||
const prodConfig = {
|
||||
domain: "https://dev-7mdjzcgwirhocfwm.ca.auth0.com",
|
||||
clientId: "TRlKzdNBynpo9tU1RSmnF0p8d3IEam4J",
|
||||
audience: "alphane-api",
|
||||
apiBaseUrl: "",
|
||||
webSocketBaseUrl: "",
|
||||
applicationName: "ALPHANE",
|
||||
}
|
||||
|
||||
const devConfig = {
|
||||
domain: "https://dev-7mdjzcgwirhocfwm.ca.auth0.com",
|
||||
clientId: "TRlKzdNBynpo9tU1RSmnF0p8d3IEam4J",
|
||||
audience: "alphane-api",
|
||||
apiBaseUrl: "http://localhost:3000",
|
||||
webSocketBaseUrl: "ws://localhost:3000",
|
||||
applicationName: "ALPHANE",
|
||||
}
|
||||
|
||||
const localProductionConfig = {
|
||||
domain: "https://dev-7mdjzcgwirhocfwm.ca.auth0.com",
|
||||
clientId: "TRlKzdNBynpo9tU1RSmnF0p8d3IEam4J",
|
||||
audience: "alphane-api",
|
||||
apiBaseUrl: "http://localhost:8080",
|
||||
webSocketBaseUrl: "ws://localhost:8080",
|
||||
applicationName: "ALPHANE (production)",
|
||||
}
|
||||
|
||||
let config = prodConfig
|
||||
|
||||
if (ENVIRONMENT === "production" && window.location.host === "localhost:8080") {
|
||||
config = localProductionConfig
|
||||
} else if (window.location.host === "localhost:8080") {
|
||||
config = devConfig
|
||||
}
|
||||
|
||||
export const APPLICATION_NAME = config.applicationName
|
||||
|
||||
export const API_BASE_URL = config.apiBaseUrl
|
||||
export const WEB_SOCKET_BASE_URL = config.webSocketBaseUrl
|
||||
|
||||
export const AUTH0_DOMAIN = stripTrailingSlash(config.domain)
|
||||
export const AUTH0_AUDIENCE = config.audience
|
||||
export const AUTH0_CLIENT_ID = config.clientId
|
||||
Reference in New Issue
Block a user