|
|
|
@ -23,7 +23,7 @@ Flight::group('', function () {
|
|
|
|
|
// Test 1: Root route
|
|
|
|
|
Flight::route('/', function () {
|
|
|
|
|
echo '<span id="infotext">Route text:</span> Root route works!';
|
|
|
|
|
if(Flight::request()->query->redirected) {
|
|
|
|
|
if (Flight::request()->query->redirected) {
|
|
|
|
|
echo '<br>Redirected from /redirect route successfully!';
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
@ -100,20 +100,19 @@ Flight::group('', function () {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Test 10: Halt
|
|
|
|
|
Flight::route('/halt', function() {
|
|
|
|
|
Flight::route('/halt', function () {
|
|
|
|
|
Flight::halt(400, 'Halt worked successfully');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}, [ new LayoutMiddleware() ]);
|
|
|
|
|
|
|
|
|
|
// Test 9: JSON output
|
|
|
|
|
Flight::route('/json', function() {
|
|
|
|
|
Flight::route('/json', function () {
|
|
|
|
|
Flight::json(['message' => 'JSON renders successfully!']);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Test 11: Redirect
|
|
|
|
|
Flight::route('/redirect', function() {
|
|
|
|
|
Flight::route('/redirect', function () {
|
|
|
|
|
Flight::redirect('/?redirected=1');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|