Explorar el Código

Require Flight and test out its routing abilities

axkuhta hace 1 año
padre
commit
07005e77a5
Se han modificado 2 ficheros con 13 adiciones y 3 borrados
  1. 3 1
      composer.json
  2. 10 2
      index.php

+ 3 - 1
composer.json

@@ -12,5 +12,7 @@
             "email": "11133304+AXKuhta@users.noreply.github.com"
         }
     ],
-    "require": {}
+    "require": {
+        "mikecao/flight": "^2.0"
+    }
 }

+ 10 - 2
index.php

@@ -1,5 +1,13 @@
 <?php
 	require 'vendor/autoload.php';
 
-	echo "Hello!\n";
-?>
+	Flight::route('/', function(){
+		echo 'hello world!';
+	});
+
+	Flight::route('/test', function(){
+		echo 'routed page test';
+	});
+
+	Flight::start();
+?>