Инициализация проекта
Загрузка проекта на GIT
This commit is contained in:
19
backend/app/functions/routing.php
Normal file
19
backend/app/functions/routing.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
// Функция роутинга API
|
||||
function handleRouting($routes = []) {
|
||||
|
||||
$request = $_SERVER['REQUEST_URI'];
|
||||
$path = parse_url($request, PHP_URL_PATH);
|
||||
|
||||
if (isset($routes[$path])) {
|
||||
|
||||
$file_path = $routes[$path];
|
||||
global $_POST, $_FILES, $_SERVER, $_GET;
|
||||
include $file_path;
|
||||
exit;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user