File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches : [main]
66
7+ env :
8+ BACKEND_URL : https://flowops-backend.azurewebsites.net
9+
710jobs :
811 deploy :
912 name : Deploy to Azure
@@ -18,12 +21,12 @@ jobs:
1821 with :
1922 node-version : ' 20'
2023
21- # Build Frontend
24+ # Build Frontend with production API URL
2225 - name : Build Frontend
2326 run : |
2427 cd frontend
2528 npm ci
26- npm run build
29+ VITE_API_URL=${{ env.BACKEND_URL }}/api npm run build
2730 cp server.js dist/
2831 cp package.json dist/
2932 cd dist
Original file line number Diff line number Diff line change 11import axios from 'axios' ;
22
3+ // API URL - uses environment variable in production, localhost in development
4+ const API_BASE_URL = import . meta. env . VITE_API_URL || 'http://localhost:3001/api' ;
5+
36const api = axios . create ( {
4- baseURL : 'http://localhost:3001/api'
7+ baseURL : API_BASE_URL
58} ) ;
69
710// Request interceptor to add auth token
@@ -110,7 +113,7 @@ export const attachmentsAPI = {
110113 upload : ( taskId , formData ) => api . post ( `/tasks/${ taskId } /attachments` , formData , {
111114 headers : { 'Content-Type' : 'multipart/form-data' }
112115 } ) ,
113- download : ( id ) => `http://localhost:3001/api /attachments/${ id } /download` ,
116+ download : ( id ) => `${ API_BASE_URL } /attachments/${ id } /download` ,
114117 delete : ( id ) => api . delete ( `/attachments/${ id } ` )
115118} ;
116119
You can’t perform that action at this time.
0 commit comments