mirror of
https://github.com/dannyvankooten/AltoRouter.git
synced 2025-08-01 22:20:17 +02:00
add support for php's built-in web server to example. #226
This commit is contained in:
@@ -1,6 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
require '../../AltoRouter.php';
|
require __DIR__ . '/../../AltoRouter.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This can be useful if you're using PHP's built-in web server, to serve files like images or css
|
||||||
|
* @link https://secure.php.net/manual/en/features.commandline.webserver.php
|
||||||
|
*/
|
||||||
|
if (file_exists($_SERVER['SCRIPT_FILENAME']) && pathinfo($_SERVER['SCRIPT_FILENAME'], PATHINFO_EXTENSION) !== 'php') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$router = new AltoRouter();
|
$router = new AltoRouter();
|
||||||
$router->setBasePath('/AltoRouter/examples/basic');
|
$router->setBasePath('/AltoRouter/examples/basic');
|
||||||
|
Reference in New Issue
Block a user