|
1 | 1 | // Vite supports JSON import without assertions |
2 | 2 | import pkg from "#/package.json" |
3 | 3 | const { name, version, description } = pkg |
| 4 | +const { env } = import.meta |
4 | 5 |
|
5 | 6 | export { |
6 | 7 | name, |
@@ -29,18 +30,18 @@ export const concordanceRegistry = cdk.initializeRegistry({ |
29 | 30 | api: concordanceApi, |
30 | 31 | }) |
31 | 32 |
|
32 | | -const loginServer = import.meta.env.VITE_LOGIN_SERVER || null |
| 33 | +const loginServer = env.VITE_LOGIN_SERVER || null |
33 | 34 | export const loginServerUrl = loginServer && loginServer.replace(/https?:\/\//, "") |
34 | 35 | export const loginServerSsl = loginServer && loginServer.startsWith("https://") |
35 | 36 |
|
36 | | -export const allowedUsers = (import.meta.env.VITE_ALLOWED_USERS || "").split(",").filter(Boolean).map(uri => uri.trim()) |
37 | | -export const allowedProviders = (import.meta.env.VITE_ALLOWED_PROVIDERS || "").split(",").filter(Boolean).map(uri => uri.trim()) |
| 37 | +export const allowedUsers = (env.VITE_ALLOWED_USERS || "").split(",").filter(Boolean).map(uri => uri.trim()) |
| 38 | +export const allowedProviders = (env.VITE_ALLOWED_PROVIDERS || "").split(",").filter(Boolean).map(uri => uri.trim()) |
38 | 39 |
|
39 | | -export const baseUrl = import.meta.env.BASE_URL || "/" |
40 | | -export const isProduction = import.meta.env.MODE === "production" |
| 40 | +export const baseUrl = env.BASE_URL || "/" |
| 41 | +export const isProduction = env.MODE === "production" |
41 | 42 |
|
42 | | -export const dbKey = isProduction ? "opac-de-627" : "test-k10plus" |
43 | | -export const examples = isProduction ? [ "389598534", "1830228498", "1646529499" ] : [] |
| 43 | +export const dbKey = env.DBKEY || "opac-de-627" |
| 44 | +export const examples = (env.EXAMPLES || "").split(",") |
44 | 45 |
|
45 | 46 | let _additionalText = import.meta.env.VITE_ADDITIONAL_TEXT || null |
46 | 47 | // If the additional text is not enclosed in a HTML tag, use <p></p> |
|
0 commit comments