This commit is contained in:
2019-07-01 21:17:33 +02:00
parent dbca57d7e1
commit 761f766ea0
5 changed files with 18 additions and 14 deletions

View File

@@ -31,7 +31,7 @@ export default {
try {
const [start, end] = [this.window.getStart(), this.window.getEnd()]
const sample = Math.round(((end - start) / 60) / 288) || 1
const host = 'http://localhost:3000'
const host = process.env.NODE_ENV === 'development' ? 'http://localhost:3000' : ''
const fetchUrl = `${host}/type/${this.type}/startDate/${start}/endDate/${end}/sample/${sample}`
const response = await fetch(fetchUrl)
this.data = await response.json()