Skip to content

Commit 50be820

Browse files
authored
Merge pull request #73 from khoshov/feature/cors
add api host secret
2 parents 9f37655 + 234d34c commit 50be820

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/deploy_dev.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626

2727
- name: Build frontend
2828
working-directory: frontend
29+
env:
30+
VITE_API_BASE_URL: ${{ secrets.DEV_API_BASE_URL }}
2931
run: npm run build
3032

3133
- name: Deploy

frontend/.env.production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# API Base URL for production
2+
VITE_API_BASE_URL=https://your-domain.com/api/v1

frontend/src/lib/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import axios from 'axios';
22
import type { Book, Publisher, Tag, PaginatedResponse } from '@/types';
33

4-
const API_BASE_URL = 'http://localhost:8001/api/v1';
4+
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8001/api/v1';
55

66
const api = axios.create({
77
baseURL: API_BASE_URL,

0 commit comments

Comments
 (0)