Created
July 16, 2011 15:37
-
-
Save aambrozkiewicz/1086459 to your computer and use it in GitHub Desktop.
aleksandera.pl under hood
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'app/app.php'; | |
require_once 'app/view.php'; | |
$app = new app; | |
try { | |
$app->get('/404', function() { | |
echo view::render('views/404.php'); | |
})->get('/(\w+)?', function($name = null) { | |
echo view::render('views/index.php', array( | |
'hacking' => $name | |
)); | |
})->run(); | |
} catch (HandlerNotFoundException $e) { | |
header("Location: /404"); | |
} catch(Exception $e) { | |
die($e->getMessage()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment