Initial commit

This commit is contained in:
Chris Smith
2025-12-12 21:22:48 +01:00
parent 195c2f48ff
commit d225d12555
30 changed files with 976 additions and 3587 deletions

30
config/config.php Normal file
View 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),
];