Skip to content

Commit da28b0c

Browse files
committed
Enviroment variables
1 parent 535c961 commit da28b0c

File tree

7 files changed

+17
-14
lines changed

7 files changed

+17
-14
lines changed

.env.development

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VUE_APP_API_URL=http://localhost:8000/api
2+
VUE_APP_DISCORD_API_URL=http://localhost:4000/api

.env.production

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VUE_APP_API_URL=https://aaaimx-admin.herokuapp.com/api
2+
VUE_APP_DISCORD_API_URL=https://aaaimx-discord.herokuapp.com/api

.env.staging

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
VUE_APP_API_URL=https://aaaimx-admin-stage.herokuapp.com/api
2+
VUE_APP_DISCORD_API_URL=https://aaaimx-discord.herokuapp.com/api

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.4.2",
44
"private": true,
55
"scripts": {
6-
"serve": "cross-env NODE_ENV=development vue-cli-service serve",
7-
"prod": "cross-env NODE_ENV=prod vue-cli-service serve",
6+
"serve": "vue-cli-service serve --mode development",
7+
"stage": "vue-cli-service serve --mode staging",
88
"build": "vue-cli-service build --modern",
99
"lint": "vue-cli-service lint",
1010
"build:gh-pages": "cross-env DEPLOY_ENV=GH_PAGES npm run build",
@@ -21,7 +21,9 @@
2121
"chart.js": "^2.9.3",
2222
"core-js": "^3.6.5",
2323
"dayjs": "^1.8.35",
24+
"file-saver": "^2.0.5",
2425
"js-cookie": "^2.2.1",
26+
"jspdf": "^2.2.0",
2527
"jwt-decode": "^3.1.2",
2628
"lodash": "^4.17.20",
2729
"numeral": "^2.0.6",
@@ -33,7 +35,8 @@
3335
"vue-copy-to-clipboard": "^1.0.3",
3436
"vue-linkify": "^1.0.1",
3537
"vue-router": "^3.4.3",
36-
"vuex": "^3.5.1"
38+
"vuex": "^3.5.1",
39+
"xlsx": "^0.16.9"
3740
},
3841
"devDependencies": {
3942
"@vue/cli-plugin-babel": "~4.5.4",

src/services/axios.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import axios from 'axios'
22
import { getToken } from '@/utils/auth'
3-
3+
console.log(process.env.VUE_APP_API_URL, process.env.NODE_ENV)
44
// create an axios instance
55
const service = axios.create({
6-
baseURL:
7-
process.env.NODE_ENV === 'development'
8-
? 'http://127.0.0.1:8000/api'
9-
: 'https://aaaimx-admin.herokuapp.com/api', // url = base url + request url
6+
baseURL: process.env.VUE_APP_API_URL, // url = base url + request url
107
// withCredentials: true, // send cookies when cross-domain requests
118
mode: 'cors',
129
credentials: 'same-origin',

src/services/discord.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
import axios from 'axios'
2-
2+
console.log(process.env.VUE_APP_DISCORD_API_URL, process.env.NODE_ENV)
33
// create an axios instance
44
const service = axios.create({
5-
baseURL:
6-
process.env.NODE_ENV === 'development'
7-
? 'http://127.0.0.1:4000/api'
8-
: 'https://aaaimx-discord.herokuapp.com/api', // url = base url + request url
5+
baseURL: process.env.VUE_APP_DISCORD_API_URL, // url = base url + request url
96
// withCredentials: true, // send cookies when cross-domain requests
107
mode: 'cors',
118
timeout: 10000,

0 commit comments

Comments
 (0)