Skip to content

Commit 732e770

Browse files
authored
changed vite api uri (#16)
* changed vite api uri * added to test.yml
1 parent 8ce842c commit 732e770

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
NODE_ENV: test
1515
MONGO_TEST_URI: ${{ secrets.MONGO_TEST_URI }}
1616
JWT_SECRET: ${{ secrets.JWT_SECRET }}
17+
VITE_API_URL: ${{ secrets.VITE_API_URL }}
1718

1819
steps:
1920
- name: Checkout repository

client/src/utils/api.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import axios from 'axios';
22

3+
if (!import.meta.env.VITE_API_URL) {
4+
throw new Error('VITE_API_URL is not defined');
5+
}
6+
37
const API = axios.create({
4-
baseURL: import.meta.env.VITE_API_URL || '/api',
8+
baseURL: import.meta.env.VITE_API_URL,
59
});
610

711
// Request interceptor to inject token

0 commit comments

Comments
 (0)