print('

Hello all routes!

')); // there are shorthands for methods you would expect such as // get|post|put|patch|delete|options App::get('/', fn() => print('homepage')); // form is a shorthand that accepts GET and POST methods App::form('/submit', fn() => print('i match on GET and POST methods')); // any is a shorthand that does what you would expect App::any('/example', fn() => print('i match on any method')); // if not satisfied you can use the match function which takes a // string of methods separated by the pipe symbol App::match('get|post|put', '/match', fn() => print('i match on any method you like')); // optional route parameters App::get('/echo/$text?', fn($text = 'You sent nothing') => print($text)); // required route parameters App::get('/echo_must_supply_text/$text', fn($text) => print($text)); // group together routes and middlewares. a prefix can be added to // prefix each route in the group with a given URI. the group will // be skipped if the request URI does not begin with the one supplied. // middlewares defined in here will only affect routes matched from // within or any child groups App::group('/test', function() { App::use( fn() => print('

Hello all routes matched within this or any child groups!

')); // this will be matched as /test/ App::get('/', fn() => print('Testing 123')); // you may also define a group without a prefix App::group('', function() { App::get('/test', fn() => print('Testing 456')); }); }); // finally, since no route was matched, show a 404 page http_response_code(404); ?>

404 not found

Sorry, the page you requested could not be found