Files
api-btekno/public/router.php

17 lines
363 B
PHP
Raw Normal View History

<?php
/**
* Router script for PHP built-in server
* Usage: php -S localhost:8000 router.php
*/
// If the request is for a file that exists, serve it
$file = __DIR__ . $_SERVER['REQUEST_URI'];
if (file_exists($file) && is_file($file) && $_SERVER['REQUEST_URI'] !== '/') {
return false;
}
// Otherwise, route to index.php
require __DIR__ . '/index.php';