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 e98b51c2ea
commit b0db2141bf
2 changed files with 8 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
frontend_url: http://localhost:3000
frontend_url: http://localhost:5173
debug: true
application:
@@ -6,3 +6,8 @@ application:
host: 127.0.0.1
base_url: http://127.0.0.1:3100
name: "sta-dev"
cors:
allowed_origins: ["*"]
allow_credentials: false
max_age_secs: 3600

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)