mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 04:16:00 +00:00
22 lines
504 B
TypeScript
22 lines
504 B
TypeScript
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';
|
|
}
|