From 0931cb4c8774df6d270e0af33e572438a162ae18 Mon Sep 17 00:00:00 2001 From: Ruben Beltran del Rio Date: Sun, 29 Aug 2021 22:20:01 +0200 Subject: Prepare for deploy --- src/lib/stores/prompt.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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) { -- cgit