Skip to content

Commit

Permalink
Use Host URL as API baseURL
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Jogeleit <frank.jogeleit@web.de>
  • Loading branch information
fjogeleit authored and poiana committed Jun 3, 2022
1 parent bb91823 commit 28c18d1
Show file tree
Hide file tree
Showing 3 changed files with 8,856 additions and 8,641 deletions.
1 change: 1 addition & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VUE_APP_API="http://localhost:2802"
7 changes: 2 additions & 5 deletions frontend/src/http.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import axios from 'axios';

// const axiosParams = function axiosParams() {
// const params = new URLSearchParams();
// return params;
// };
const production = process.env.NODE_ENV === 'production';

const api = axios.create({
baseURL: 'http://localhost:2802/api/v1',
baseURL: `${production ? `//${window.location.host}` : process.env.VUE_APP_API}/api/v1`,
headers: {
'Content-type': 'application/json',
'Access-Control-Allow-Origin': '*',
Expand Down

0 comments on commit 28c18d1

Please sign in to comment.