Last active
June 28, 2018 09:11
-
-
Save john555/084a35fb619ae1e03ae0bfe4475a5eba to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
include_once 'Request.php'; | |
include_once 'Router.php'; | |
$router = new Router(new Request); | |
$router->get('/', function() { | |
return <<<HTML | |
<h1>Hello world</h1> | |
HTML; | |
}); | |
$router->get('/profile', function($request) { | |
return <<<HTML | |
<h1>Profile</h1> | |
HTML; | |
}); | |
$router->post('/data', function($request) { | |
return json_encode($request->getBody()); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment