feat: Add CORS middleware untuk akses dari browser lokal

This commit is contained in:
mwpn
2025-12-17 13:56:32 +07:00
parent bbe4cc000b
commit 89c9ea93c8
3 changed files with 142 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ Sistem API Retribusi berbasis Slim Framework 4 dengan arsitektur modular untuk i
- **Modular Architecture** - Struktur code yang terorganisir dan mudah di-scale
- **JWT Authentication** - Secure authentication dengan role-based access
- **CORS Support** - Cross-Origin Resource Sharing untuk akses dari browser
- **CRUD Master Data** - Locations, Gates, Tariffs dengan audit logging
- **Realtime Dashboard** - SSE (Server-Sent Events) untuk update real-time
- **Data Aggregation** - Daily & Hourly summary untuk reporting
@@ -137,6 +138,14 @@ JWT_ISSUER=api-btekno
# API Key
RETRIBUSI_API_KEY=your-api-key-here
# CORS (Cross-Origin Resource Sharing)
# Set '*' untuk allow semua origin (development)
# Atau list origin yang diizinkan dipisah koma: http://localhost:3000,https://app.example.com
CORS_ALLOWED_ORIGINS=*
CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
CORS_ALLOWED_HEADERS=Content-Type,Authorization,X-API-KEY,Accept,Origin
CORS_ALLOW_CREDENTIALS=true
```
## 📡 API Endpoints