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 | |
/** | |
* by setting the regex condition for the :method param to '.+', it matches | |
* everything, including "/" chars. this lets us match any URL of the format. | |
* | |
* /api/foo outputs "foo" | |
* /api/foo/bar/baz outputs "foo/bar/baz" | |
*/ | |
$app->get('/api/:method', function($method) use ($app) { | |
echo $method; |