aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2021-08-29 22:20:01 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2021-08-29 22:20:01 +0200
commit0931cb4c8774df6d270e0af33e572438a162ae18 (patch)
treed30094707863607b7e0a9c4933909705cec869fc /src/lib
parent38431710cfb1cc1ffd7297085d069be1328f083b (diff)
Prepare for deploy
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/stores/prompt.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/stores/prompt.js b/src/lib/stores/prompt.js
index 59df711..7559657 100644
--- a/src/lib/stores/prompt.js
+++ b/src/lib/stores/prompt.js
@@ -2,14 +2,15 @@ import { readable } from 'svelte/store';
import { browser } from '$app/env';
const internals = {
- kDataPrefix: 'http://localhost:3000/data/',
+ kHost: import.meta.env.VITE_PUBLIC_BASE_PATH || 'http://localhost:3000',
+ kDataPrefix: '/data/',
kAdjectivesPath: '/adjectives.json',
kNounsPath: '/nouns.json',
async get(locale, path) {
const shortLocale = locale.split('-')[0];
- const targetFile = internals.kDataPrefix + shortLocale + path;
+ const targetFile = internals.kHost + internals.kDataPrefix + shortLocale + path;
const data = browser && sessionStorage.getItem(targetFile);
if (data) {