diff options
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/stores/prompt.js | 5 |
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) { |