More loader

This commit is contained in:
2024-07-20 14:04:08 +02:00
parent 0951285ff8
commit 7461a42586
10 changed files with 161 additions and 40 deletions
+16 -7
View File
@@ -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']);