mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 19:56:02 +00:00
metadata loaders as svelte stream
This commit is contained in:
21
packages/web-svelte/src/utility/resolveApi.ts
Normal file
21
packages/web-svelte/src/utility/resolveApi.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
export default function resolveApi() {
|
||||
if (window['require']) {
|
||||
const electron = window['require']('electron');
|
||||
|
||||
if (electron) {
|
||||
const port = electron.remote.getGlobal('port');
|
||||
if (port) {
|
||||
return `http://localhost:${port}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// // eslint-disable-next-line
|
||||
// const apiUrl = process.env.REACT_APP_API_URL;
|
||||
// if (apiUrl) {
|
||||
// if (apiUrl == 'ORIGIN') return window.location.origin;
|
||||
// return apiUrl;
|
||||
// }
|
||||
|
||||
return 'http://localhost:3000';
|
||||
}
|
||||
Reference in New Issue
Block a user