Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set API URL from environment variable #237

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_FD_API_URL=http://localhost:9111/v3
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_FD_API_URL=http://165.227.172.191:9111/v3
10 changes: 1 addition & 9 deletions src/utils/fd-axios.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
import axios from 'axios'

let FD_API_URL

if (window.location.host === 'fd-vue-webapp.herokuapp.com') {
FD_API_URL = 'http://165.227.172.191:9111/v3'
} else {
FD_API_URL = 'http://' + window.location.hostname + ':9111/v3'
}

export default axios.create({
baseURL: FD_API_URL,
baseURL: process.env.VUE_APP_FD_API_URL,
withCredentials: true,
headers: {
'Content-Type': 'application/json'
Expand Down