Skip to content

Commit 4f3fd47

Browse files
committed
Configure Azure deployment with Cosmos DB and CI/CD
1 parent 56fa13f commit 4f3fd47

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.github/workflows/cd.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches: [main]
66

7+
env:
8+
BACKEND_URL: https://flowops-backend.azurewebsites.net
9+
710
jobs:
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

frontend/src/services/api.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import 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+
36
const 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

0 commit comments

Comments
 (0)