Able to fetch from local api when running in a development node environemtn.

This commit is contained in:
2020-01-23 00:22:20 +01:00
parent 2a34a3e421
commit 60d3f4de85
2 changed files with 14 additions and 2 deletions

View File

@@ -12,7 +12,13 @@ export default {
async mounted() { async mounted() {
let canvas = this.$refs["purchase-chart"].getContext("2d"); let canvas = this.$refs["purchase-chart"].getContext("2d");
let _response = await fetch("/api/purchase/statistics"); let _response = undefined
if (process.env.NODE_ENV == 'development') {
_response = await fetch("http://localhost:30030/api/purchase/statistics");
}
else {
_response = await fetch("/api/purchase/statistics");
}
let response = await _response.json(); let response = await _response.json();
let labels = []; let labels = [];
let blue = { let blue = {

View File

@@ -9,7 +9,13 @@ export default {
async mounted() { async mounted() {
let canvas = this.$refs["win-chart"].getContext("2d"); let canvas = this.$refs["win-chart"].getContext("2d");
let _response = await fetch("/api/purchase/statistics/color"); let _response = undefined
if (process.env.NODE_ENV == 'development') {
_response = await fetch("http://localhost:30030/api/purchase/statistics/color");
}
else {
_response = await fetch("/api/purchase/statistics/color");
}
let response = await _response.json(); let response = await _response.json();
let labels = ["Vunnet"]; let labels = ["Vunnet"];
let blue = { let blue = {