Skip to content

Commit

Permalink
Enviroments add
Browse files Browse the repository at this point in the history
  • Loading branch information
mwlt68 committed Mar 12, 2023
1 parent 8cc1bac commit 00db5f4
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_URL=https://localhost:7175
1 change: 1 addition & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_API_URL=test
40 changes: 40 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.10",
"axios": "^1.2.1",
"env-cmd": "^10.1.0",
"eslint-plugin-react-hooks": "^4.6.0",
"localforage": "^1.10.0",
"lottie-react": "^2.3.1",
Expand All @@ -30,10 +31,10 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"start:prod": "env-cmd -f .env.production react-scripts start",
"start:dev": "env-cmd -f .env.development react-scripts start",
"build:prod": "env-cmd -f .env.production react-scripts build",
"build:dev": "env-cmd -f .env.development react-scripts build"
},
"eslintConfig": {
"extends": [
Expand Down
4 changes: 2 additions & 2 deletions src/services/api-service/ApiBaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { AuthManager } from "../../utils/helpers/AuthManager";

export abstract class ApiBaseService {

static readonly BaseUrl: string = "https://localhost:7175";
static BaseUrl: string |undefined = process.env.REACT_APP_API_URL;
static isBusy: boolean = false;

static async sendRequestBase<ResponseModel>(
Expand All @@ -27,7 +27,7 @@ export abstract class ApiBaseService {
) {
this.isBusy = true;
let isUnauthorized: boolean = false;

debugger
var response = await axios
.request({
baseURL: this.BaseUrl,
Expand Down

0 comments on commit 00db5f4

Please sign in to comment.