Add: CORS config for all environments

main
boban 2026-04-19 01:04:46 +02:00
parent 2ca74dd80e
commit 707517bc39
1 changed files with 32 additions and 0 deletions

32
src/config/cors.php Normal file
View File

@ -0,0 +1,32 @@
<?php
return [
'paths' => ['api/*', 'v1/*'],
'allowed_methods' => ['*'],
'allowed_origins' => [
env('APP_URL', 'http://localhost'),
env('APP_CONNECT_URL', 'http://localhost'),
// Lokal:
'http://app.aziros.local',
'http://api.aziros.local',
// Staging:
'https://app.staging.aziros.com',
// Production:
'https://app.aziros.com',
'https://www.aziros.com',
],
'allowed_origins_patterns' => [
'#^https?://.*\.aziros\.(com|local)$#',
],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
];