diff --git a/.env b/.env new file mode 100644 index 0000000..5fc10d3 --- /dev/null +++ b/.env @@ -0,0 +1 @@ +VUE_APP_API_URL=http://localhost:8000 \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..d742165 --- /dev/null +++ b/.env.production @@ -0,0 +1 @@ +VUE_APP_API_URL=https://api.csgow.tf \ No newline at end of file diff --git a/package.json b/package.json index d18125c..4dc3fd6 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "build": "vue-cli-service build --mode production", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/src/components/Footer.vue b/src/components/Footer.vue index 09fb280..ce17406 100644 --- a/src/components/Footer.vue +++ b/src/components/Footer.vue @@ -1,17 +1,20 @@ diff --git a/src/views/Match.vue b/src/views/Match.vue index 84adf6b..1374ca6 100644 --- a/src/views/Match.vue +++ b/src/views/Match.vue @@ -56,7 +56,7 @@ export default { // Functions const GetMatch = () => { axios - .get(`http://localhost:8000/match/${props.match_id}`) + .get(`${process.env.VUE_APP_API_URL}/match/${props.match_id}`) .then((response) => { document.title = `${response.data.map} | csgoWTF` data.matchDetails = response.data diff --git a/src/views/Player.vue b/src/views/Player.vue index 79573c0..8387f8e 100644 --- a/src/views/Player.vue +++ b/src/views/Player.vue @@ -224,7 +224,7 @@ export default { data.statusError = 'Is not a valid authcode' const res = await axios - .post(`http://localhost:8000/player/trackme`, `id=${store.state.id64}&authcode=${data.userData.authcode}&sharecode=${data.userData.sharecode}`) + .post(`${process.env.VUE_APP_API_URL}/player/trackme`, `id=${store.state.id64}&authcode=${data.userData.authcode}&sharecode=${data.userData.sharecode}`) if (res.status === 401) { data.statusError = 'Data does not match player' @@ -239,7 +239,7 @@ export default { const GetUser = () => { axios - .get(`http://localhost:8000/player/${props.id}`) + .get(`${process.env.VUE_APP_API_URL}/player/${props.id}`) .then((response) => { data.playerDetails = response.data data.matches = response.data.matches