More loader
This commit is contained in:
+16
-7
@@ -1,12 +1,21 @@
|
||||
<?php
|
||||
|
||||
// Namespaces
|
||||
use Pecee\SimpleRouter\SimpleRouter;
|
||||
use Api\Login\Login;
|
||||
|
||||
use Pecee\Http\Request;
|
||||
/*
|
||||
SimpleRouter::error(function (Request $request, \Exception $exception) {
|
||||
switch ($exception->getCode()) {
|
||||
// Page not found
|
||||
case 404:
|
||||
redirect('/phpCourse/exam/not-found', 404);
|
||||
}
|
||||
});
|
||||
*/
|
||||
//404
|
||||
SimpleRouter::get('/not-found', [Pages\NotFound\NotFound::class, "render"]);
|
||||
//Index
|
||||
SimpleRouter::get('/', function () {
|
||||
return 'Hello world';
|
||||
});
|
||||
|
||||
$l = new Login();
|
||||
|
||||
SimpleRouter::get("/api/login", [Login::class, 'get']);
|
||||
//API
|
||||
SimpleRouter::get("/api/login", [Api\Login\Login::class, 'post']);
|
||||
|
||||
Reference in New Issue
Block a user