hash based routing in env file

ref #23
This commit is contained in:
Philipp Dormann 2021-01-02 22:23:32 +01:00
parent a50ea15b38
commit 3396d17358
3 changed files with 9 additions and 2 deletions

View File

@ -1,5 +1,6 @@
const config = { const config = {
baseurl: 'https://dev.lauf-fuer-kaya.de', baseurl: 'https://dev.lauf-fuer-kaya.de',
fallback_username: 'admin', fallback_username: 'admin',
fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3' fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3',
prefersHashRouting: true
}; };

View File

@ -2,5 +2,6 @@ const config = {
baseurl: 'http://localhost:4010', baseurl: 'http://localhost:4010',
// optional params ⏬ // optional params ⏬
fallback_username: 'demo', fallback_username: 'demo',
fallback_password: 'demo' fallback_password: 'demo',
prefersHashRouting: true
}; };

View File

@ -7,6 +7,11 @@
}); });
console.log($router.path); console.log($router.path);
console.log(config); console.log(config);
if (config.prefersHashRouting) {
if (config.prefersHashRouting === true) {
router.useHashNavigation();
}
}
import localForage from "localforage"; import localForage from "localforage";
import { addMessages, init, getLocaleFromNavigator } from "svelte-i18n"; import { addMessages, init, getLocaleFromNavigator } from "svelte-i18n";
import en from "./locales/en.json"; import en from "./locales/en.json";