🎨 Updates URL handling

This commit is contained in:
Moritz Kröger 2019-05-08 22:20:40 +01:00
parent 2d9c50fe38
commit 961c5ec44e
3 changed files with 3 additions and 2 deletions

View file

@ -156,7 +156,6 @@
.map(this.getScorePerParty)
.sort((a, b) => a.score - b.score)
.reverse()
console.log(parties)
this.totalScoredPoints = this.scores
.map(s => s.highestScore)
.reduce(addUp, 0)

1
src/config/api.js Normal file
View file

@ -0,0 +1 @@
export const IPDATA_URL = 'https://api.ipdata.co/?api-key=test'

View file

@ -1,8 +1,9 @@
import { DEFAULT_LOCALE, SUPPORTED_LOCALES } from '@/config'
import { IPDATA_URL } from '@/config/api'
import i18n from './index'
export const getCountryByIP = async () => {
const response = await fetch('https://api.ipdata.co/?api-key=test')
const response = await fetch(IPDATA_URL)
return response.json()
}