aboutsummaryrefslogtreecommitdiff
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
parent38431710cfb1cc1ffd7297085d069be1328f083b (diff)
Prepare for deploy
-rw-r--r--src/lib/stores/prompt.js5
-rw-r--r--svelte.config.js4
2 files changed, 6 insertions, 3 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) {
diff --git a/svelte.config.js b/svelte.config.js
index eec59a1..1652cf6 100644
--- a/svelte.config.js
+++ b/svelte.config.js
@@ -2,9 +2,11 @@ import adapter from '@sveltejs/adapter-static';
/** @type {import('@sveltejs/kit').Config} */
const config = {
- adapter: adapter(),
kit: {
// hydrate the <div id="svelte"> element in src/app.html
+ adapter: adapter({
+ fallback: 'index.html'
+ }),
target: '#svelte'
}
};