diff --git a/.env b/.env new file mode 100644 index 0000000..7c2401e --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +VUE_APP_API_URL=https://testnet.getumbrel.com/ +VUE_APP_NETWORK=testnet \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..26fa8a7 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +VUE_APP_API_URL=/ +VUE_APP_NETWORK=mainnet \ No newline at end of file diff --git a/.env.staging b/.env.staging index 802aea5..7c2401e 100644 --- a/.env.staging +++ b/.env.staging @@ -1 +1,2 @@ -NODE_ENV=staging \ No newline at end of file +VUE_APP_API_URL=https://testnet.getumbrel.com/ +VUE_APP_NETWORK=testnet \ No newline at end of file diff --git a/.gitignore b/.gitignore index d43f01b..7c50417 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,6 @@ node_modules /dist -# local env files -.env.local -.env.*.local - # Log files npm-debug.log* yarn-debug.log* diff --git a/src/App.vue b/src/App.vue index 35fd84f..b2a46ba 100644 --- a/src/App.vue +++ b/src/App.vue @@ -107,6 +107,7 @@ export default { } }, created() { + console.log(process.env.VUE_APP_API_URL, process.env.VUE_APP_NETWORK); this.updateViewPortHeightCSS(); //for 100vh consistency window.addEventListener("resize", this.updateViewPortHeightCSS); diff --git a/src/components/BitcoinWallet.vue b/src/components/BitcoinWallet.vue index 562800f..baabbe7 100644 --- a/src/components/BitcoinWallet.vue +++ b/src/components/BitcoinWallet.vue @@ -589,7 +589,10 @@ export default { }; try { - const res = await API.post(`api/v1/lnd/transaction`, payload); + const res = await API.post( + `${process.env.VUE_APP_API_URL}api/v1/lnd/transaction`, + payload + ); const withdrawTx = res.data; this.state.withdraw.txHash = withdrawTx.txid; this.changeMode("withdrawn"); diff --git a/src/components/LightningWallet.vue b/src/components/LightningWallet.vue index 8ca10fa..07ca0e6 100644 --- a/src/components/LightningWallet.vue +++ b/src/components/LightningWallet.vue @@ -517,7 +517,10 @@ export default { }; try { - const res = await API.post(`api/v1/lnd/lightning/payInvoice`, payload); + const res = await API.post( + `${process.env.VUE_APP_API_URL}api/v1/lnd/lightning/payInvoice`, + payload + ); if (res.data.paymentError) { return (this.state.error = res.data.paymentError); } @@ -557,7 +560,10 @@ export default { }; try { - const res = await API.post(`api/v1/lnd/lightning/addInvoice`, payload); + const res = await API.post( + `${process.env.VUE_APP_API_URL}api/v1/lnd/lightning/addInvoice`, + payload + ); this.state.receive.invoiceQR = this.state.receive.invoiceText = res.data.paymentRequest; @@ -603,7 +609,7 @@ export default { this.state.loading = true; const fetchedInvoice = await API.get( - `api/v1/lnd/lightning/invoice?paymentRequest=${this.state.send.invoiceText}` + `${process.env.VUE_APP_API_URL}api/v1/lnd/lightning/invoice?paymentRequest=${this.state.send.invoiceText}` ); if (!fetchedInvoice) { diff --git a/src/layouts/DashboardLayout.vue b/src/layouts/DashboardLayout.vue index 6f8fb23..30440de 100644 --- a/src/layouts/DashboardLayout.vue +++ b/src/layouts/DashboardLayout.vue @@ -26,17 +26,12 @@ - + Development - Testnet + v-if="network !== 'mainnet'" + class="align-self-center mr-2 text-capitalize" + >{{ network }}