fix: add fallback for api url

This commit is contained in:
Ali BARIN
2023-08-03 18:08:54 +00:00
parent 0deaa03218
commit e4e3356dc9

View File

@@ -17,7 +17,9 @@ const config: Config = {
supportEmailAddress: 'support@automatisch.io'
};
if (!config.apiUrl) {
if (!config.apiUrl && !config.graphqlUrl) {
config.apiUrl = '/';
} else if (!config.apiUrl) {
config.apiUrl = (new URL(config.graphqlUrl)).origin;
}