Skip to content

Commit

Permalink
Merge branch 'upgrade/fix-mistakes' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuseduardomedeiros committed May 23, 2024
2 parents 45c81aa + 96e76ae commit 78eefef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 2 additions & 3 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/bin/sh
JSON_STRING='window.configs = { \
"VUE_APP_BASE_API":"'${VUE_APP_BASE_API}'", \
"VUE_APP_PARENT_DOMAIN":"'${VUE_APP_PARENT_DOMAIN}'", \
"VUE_APP_LOGROCKET_ID":"'${VUE_APP_LOGROCKET_ID}'", \
"VITE_BASE_API":"'${VITE_BASE_API}'", \
"VITE_PARENT_DOMAIN":"'${VITE_PARENT_DOMAIN}'", \
}'
sed "s@// CONFIGURATIONS_PLACEHOLDER@${JSON_STRING}@" /usr/share/nginx/html/academy/index.html.tmpl > /tmp/index.html

Expand Down
11 changes: 8 additions & 3 deletions src/utils/env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
export default function getEnv(name) {
return window?.configs?.[name]
}
export default function env(name) {
return (
window?.configs?.[name] ||
import.meta.env[name] ||
window?.configs?.[`VITE_${name}`] ||
import.meta.env[`VITE_${name}`]
);
}

0 comments on commit 78eefef

Please sign in to comment.