chore(config): configure CORS and update frontend URL in development settings

Set up CORS policy to allow requests from frontend development server and
update development.yaml with proper frontend origin URL configuration.

Ref: T011 (specs/001-modbus-relay-control)
This commit is contained in:
2026-01-03 16:16:24 +01:00
parent 9a55aa433c
commit 5f0aaacb74
2 changed files with 8 additions and 3 deletions

View File

@@ -89,14 +89,14 @@
- **File**: backend/src/settings.rs
- **Complexity**: Low | **Uncertainty**: Low
- [ ] **T011** [Setup] [TDD] Update development.yaml with permissive CORS settings
- [x] **T011** [Setup] [TDD] Update development.yaml with permissive CORS settings
- Add cors section with `allowed_origins: ["*"]`, `allow_credentials: false`, `max_age_secs: 3600`
- Update `frontend_url` from `http://localhost:3000` to `http://localhost:5173` (Vite default port)
- **Test**: cargo run loads development config without errors
- **File**: backend/settings/development.yaml
- **Complexity**: Low | **Uncertainty**: Low
- [ ] **T012** [P] [Setup] [TDD] Create production.yaml with restrictive CORS settings
- [x] **T012** [P] [Setup] [TDD] Create production.yaml with restrictive CORS settings
- Add cors section with `allowed_origins: ["REACTED"]`, `allow_credentials: true`, `max_age_secs: 3600`
- Add `frontend_url: "https://REDACTED"`
- Add production-specific application settings (protocol: https, host: 0.0.0.0)