Able to fetch from local api when running in a development node environemtn.
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
@@ -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 = {
|
||||||
|
|||||||
Reference in New Issue
Block a user