Compare commits

...
Author SHA1 Message Date
Hanashi 2cfcb6131d default launch scripts to dev server 2026-08-08 19:16:32 -04:00
Hanashi 480c073c54 devex: easier to target backend in dev 2026-08-08 16:40:02 -04:00
5 changed files with 132 additions and 175 deletions
+9 -5
View File
@@ -21,11 +21,15 @@ if (import.meta.env.DEV) {
StorytellerApiHostStore.getInstance().setApiSchemeAndHost(
window.location.origin,
);
// NB: This is for Brandon to test with storyteller-web locally:
// (disabled — it overrides the origin above and points at localhost:12345,
// which breaks dev unless a local backend is running. Re-enable only when
// testing against a local storyteller-web.)
//StorytellerApiHostStore.getInstance().setDevelopment();
// Backend devs: launch with USE_LOCAL_API=1 (see
// script/website/unix_frontend_webapp_dev.sh) to point API calls at a
// local storyteller-web (http://localhost:12345). When unset — the
// frontend-dev default — this branch never runs and API calls hit
// production. Do not comment this in or out; set the env var instead.
const useLocalApi = import.meta.env.VITE_USE_LOCAL_API;
if (useLocalApi === "1" || useLocalApi === "true") {
StorytellerApiHostStore.getInstance().setDevelopment();
}
} catch (e) {
console.warn("Failed to set dev API host override", e);
}
+9 -2
View File
@@ -21,8 +21,15 @@ if (import.meta.env.DEV) {
StorytellerApiHostStore.getInstance().setApiSchemeAndHost(
window.location.origin,
);
// NB: This is for Brandon to test with storyteller-web locally:
StorytellerApiHostStore.getInstance().setDevelopment();
// Backend devs: launch with USE_LOCAL_API=1 (see
// script/website/unix_frontend_website_dev.sh) to point API calls at a
// local storyteller-web (http://localhost:12345). When unset — the
// frontend-dev default — this branch never runs and API calls hit
// production. Do not comment this in or out; set the env var instead.
const useLocalApi = import.meta.env.VITE_USE_LOCAL_API;
if (useLocalApi === "1" || useLocalApi === "true") {
StorytellerApiHostStore.getInstance().setDevelopment();
}
} catch (e) {
console.warn("Failed to set dev API host override", e);
}
+88 -168
View File
File diff suppressed because it is too large Load Diff
@@ -24,6 +24,19 @@ frontend_npm_install
export VITE_ENVIRONMENT_TYPE="production"
# # Backend devs: launch with USE_LOCAL_API=1 (or `export USE_LOCAL_API=1` once
# # in your shell profile) to point the frontend at a local storyteller-web on
# # http://localhost:12345. Unset/0 — the frontend-dev default — hits
# # production. This replaces the comment/uncomment dance around
# # StorytellerApiHostStore.setDevelopment() in src/main.tsx.
# export VITE_USE_LOCAL_API="${USE_LOCAL_API:-0}"
# if [[ "${VITE_USE_LOCAL_API}" == "1" ]]; then
# echo "USE_LOCAL_API=1 — API calls will target http://localhost:12345"
# else
# echo "API calls will target production (set USE_LOCAL_API=1 for a local backend)"
# fi
export VITE_USE_LOCAL_API="true"
nx dev artcraft-webapp
popd || exit
@@ -24,6 +24,19 @@ frontend_npm_install
export VITE_ENVIRONMENT_TYPE="production"
# # Backend devs: launch with USE_LOCAL_API=1 (or `export USE_LOCAL_API=1` once
# # in your shell profile) to point the frontend at a local storyteller-web on
# # http://localhost:12345. Unset/0 — the frontend-dev default — hits
# # production. This replaces the comment/uncomment dance around
# # StorytellerApiHostStore.setDevelopment() in src/main.tsx.
# export VITE_USE_LOCAL_API="${USE_LOCAL_API:-0}"
# if [[ "${VITE_USE_LOCAL_API}" == "1" ]]; then
# echo "USE_LOCAL_API=1 — API calls will target http://localhost:12345"
# else
# echo "API calls will target production (set USE_LOCAL_API=1 for a local backend)"
# fi
export VITE_USE_LOCAL_API="true"
nx dev artcraft-website
popd || exit