feat(API): add new api for use in another project

This commit is contained in:
2026-07-10 01:47:01 +03:30
parent a6a414c2f5
commit d5639f05fc
6 changed files with 262 additions and 0 deletions

10
public/api.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
require_once __DIR__ . '/../app/controllers/ApiController.php';
$pdo = require __DIR__ . '/../app/core/db.php';
$config = require __DIR__ . '/../app/config/config.php';
$action = $_GET['action'] ?? '';
$id = $_GET['id'] ?? null;
$api = new ApiController($pdo, $config);
$api->handle($_SERVER['REQUEST_METHOD'], $action, $id);