mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-03-13 14:40:01 +01:00
Don't try to load a local site config in development mode
This commit is contained in:
parent
5ea2d15964
commit
a3331531b3
1 changed files with 1 additions and 1 deletions
|
@ -6,7 +6,7 @@ import { trimTrailingSlash } from '../utils/common';
|
||||||
const getClientConfig = async (): Promise<ClientConfig> => {
|
const getClientConfig = async (): Promise<ClientConfig> => {
|
||||||
let url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.${window.location.hostname}.json`;
|
let url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.${window.location.hostname}.json`;
|
||||||
let config = await fetch(url, { method: 'GET' });
|
let config = await fetch(url, { method: 'GET' });
|
||||||
if(config.status===404) {
|
if(config.status===404 || import.meta.env.MODE==="development") {
|
||||||
url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.json`;
|
url = `${trimTrailingSlash(import.meta.env.BASE_URL)}/config.json`;
|
||||||
config = await fetch(url, { method: 'GET' });
|
config = await fetch(url, { method: 'GET' });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue