-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.php
39 lines (31 loc) · 1.04 KB
/
entrypoint.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
require __DIR__ . '/vendor/autoload.php';
require __DIR__ . '/app/configs/db.php';
use app\controllers\AccountController;
use app\controllers\PaymentController;
use Buki\Router\Router;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
$router = new Router([
'paths' => [
'controllers' => './app/controllers',
'middlewares' => './app/middlewares',
],
'namespaces' => [
'controllers' => 'app\\controllers',
'middlewares' => 'app\\middlewares',
],
'debug' => true,
]);
// For basic GET URI
$router->get('/token/validate', "TokenController@validate");
$router->group('/account', function (Router $router) {
($ac = new AccountController())->main($router);
});
$router->group('/payment', function (Router $router) {
($ac = new PaymentController())->main($router);
});
// For basic GET URI by using a Controller class.
//$router->post('/account/login', 'AccountController@Login');
header("Access-Control-Allow-Origin: http://localhost:5173");
$router->run();