Skip to content

Instantly share code, notes, and snippets.

@markuspoerschke
Created October 7, 2012 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markuspoerschke/3848725 to your computer and use it in GitHub Desktop.
Save markuspoerschke/3848725 to your computer and use it in GitHub Desktop.
Simple router.php for using the PHP 5.4 built-in webserver
<?php
// 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