feat(API): add new api for use in another project
This commit is contained in:
10
public/api.php
Normal file
10
public/api.php
Normal 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);
|
||||
Reference in New Issue
Block a user