passing configuration through webpack

This commit is contained in:
Fran Jurmanović
2021-06-05 13:13:39 +02:00
parent 67eda03307
commit 4ed0b75b09
5 changed files with 20 additions and 8 deletions

View File

@@ -132,7 +132,7 @@ class AppMenuElement extends BaseComponentElement {
return html`
<div data-target="app-menu.sidebar">
${menuHeader("Wallets")} ${regularMenu("/", "Home")}
${menuHeader(__CONFIG__.appName)} ${regularMenu("/", "Home")}
${authMenu("/history", "Transaction History")}
${authMenu(
"/wallet/all",

View File

@@ -1,5 +1,6 @@
{
"apiUrl": "main-wallet--dtnyc2vcdgu2re9j-gtw.qovery.io",
"apiUrl": "localhost:4000",
"apiVersion": "v1",
"ssl": true
"ssl": false,
"appName": "Wallets"
}

View File

@@ -1,11 +1,9 @@
import settings from "configs/development/app-settings.json";
class HttpClient {
private url: string;
constructor() {
this.url = `${settings.ssl ? "https" : "http"}://${settings.apiUrl}/${
settings.apiVersion
}`;
this.url = `${__CONFIG__.ssl ? "https" : "http"}://${
__CONFIG__.apiUrl
}/${__CONFIG__.apiVersion}`;
}
post(url: string, data: Object, headersParam: HeadersInit): Promise<any> {