Skip to content

Commit

Permalink
Fixed Env Window
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmylevell authored Oct 18, 2023
1 parent 51e83b8 commit a782cf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import axios from "axios";

const windowEnv = window.env.BACKEND_URL !== "${BACKEND_URL}" ? window.env.BACKEND_URL : ""

export default axios.create({
// read baseULR for dev from .env file, for production from window.env (set by webpack)
baseURL: process.env.REACT_APP_BACKEND_URL || window.env.BACKEND_URL || 'https://strapi.app.levell.ch/',
baseURL: process.env.REACT_APP_BACKEND_URL || windowEnv || 'https://strapi.app.levell.ch/',
headers: {
"Content-type": "application/json",
},
Expand Down

0 comments on commit a782cf6

Please sign in to comment.