Skip to content

Commit

Permalink
chore: add environment variable for backend
Browse files Browse the repository at this point in the history
  • Loading branch information
Matheusafonsouza committed Dec 8, 2024
1 parent a21da9c commit ff9e6f5
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 3 deletions.
9 changes: 8 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
"presets": [
["@babel/preset-env", { "targets": { "esmodules": true } }], // It's the name of the lib you installed
["@babel/preset-react", { "runtime": "automatic" }], // It's the name of the lib you installed
"@babel/preset-typescript" // It's the name of the lib you installed
"@babel/preset-typescript", // It's the name of the lib you installed
[
"babel-preset-vite",
{
"env": true,
"glob": false
}
]
]
}
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://localhost:3000
3 changes: 3 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ export default {
],
],
testMatch: ['<rootDir>/test/**/*.(test|spec).ts?(x)'],
transform: {
"^.+\\.[t|j]sx?$": "babel-jest",
},
};
98 changes: 97 additions & 1 deletion package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@typescript-eslint/parser": "^8.17.0",
"@vitejs/plugin-react": "^4.3.3",
"babel-jest": "^29.7.0",
"babel-preset-vite": "^1.1.3",
"eslint": "^9.16.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.31.0",
Expand Down
2 changes: 1 addition & 1 deletion src/config/environment.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const API_BASE_URL = 'http://localhost:3000';
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL;

0 comments on commit ff9e6f5

Please sign in to comment.