- sogoctl: supervisor avec health checks et restart auto - sogoway: gateway HTTP, auth JWT, routing par hostname - sogoms-db: microservice MariaDB avec pool par application - Protocol IPC Unix socket JSON length-prefixed - Config YAML multi-application (prokov) - Deploy script pour container Alpine gw3 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* PROKOV API - Point d'entrée
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
// Chemin racine de l'API (dossier parent)
|
|
define('API_ROOT', dirname(__DIR__));
|
|
|
|
// Headers CORS et JSON
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
header('Access-Control-Allow-Origin: *');
|
|
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
|
|
header('Access-Control-Allow-Headers: Content-Type, Authorization, X-Session-Id');
|
|
header('Access-Control-Allow-Credentials: true');
|
|
|
|
// Preflight OPTIONS
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
|
http_response_code(204);
|
|
exit;
|
|
}
|
|
|
|
// Autoload simple
|
|
spl_autoload_register(function (string $class): void {
|
|
$paths = [
|
|
'config/',
|
|
'core/',
|
|
'controllers/',
|
|
'models/',
|
|
];
|
|
|
|
foreach ($paths as $path) {
|
|
$file = API_ROOT . '/' . $path . $class . '.php';
|
|
if (file_exists($file)) {
|
|
require_once $file;
|
|
return;
|
|
}
|
|
}
|
|
});
|
|
|
|
// Chargement config
|
|
require_once API_ROOT . '/config/config.php';
|
|
|
|
// Initialisation
|
|
$router = new Router();
|
|
$router->dispatch();
|