Moving folders
This commit is contained in:
30
api/config/config.php
Normal file
30
api/config/config.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../src/Env.php';
|
||||
|
||||
use App\Env;
|
||||
|
||||
$envPath = __DIR__ . '/../.env';
|
||||
|
||||
if (file_exists($envPath)) {
|
||||
Env::load($envPath);
|
||||
}
|
||||
|
||||
$dbPath = Env::get('DB_PATH', 'db/database.sqlite');
|
||||
|
||||
if (!str_starts_with($dbPath, '/')) {
|
||||
$dbPath = __DIR__ . '/../' . $dbPath;
|
||||
}
|
||||
|
||||
return [
|
||||
'db' => [
|
||||
'path' => $dbPath,
|
||||
],
|
||||
'cors' => [
|
||||
'allow_origin' => Env::get('CORS_ALLOW_ORIGIN', '*'),
|
||||
'allow_methods' => Env::get('CORS_ALLOW_METHODS', 'GET, POST, PATCH, DELETE, OPTIONS'),
|
||||
'allow_headers' => Env::get('CORS_ALLOW_HEADERS', 'Content-Type'),
|
||||
],
|
||||
'error_reporting' => Env::getBool('ERROR_REPORTING', true),
|
||||
];
|
||||
Reference in New Issue
Block a user