Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Simple router.php for using the PHP 5.4 built-in webserver
// Filename of requested file...
$requested = __DIR__ . $_SERVER['REQUEST_URI'];
// If file exists use file
if (file_exists($requested) && !is_dir($requested)) {
return false;
// Fallback
include 'app.php';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment