-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
63 lines (53 loc) · 3.1 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
use app\core\Application;
use app\core\db\Constants;
use app\controllers\AppsController;
use app\controllers\AuthController;
use app\controllers\UsersController;
use app\controllers\DemandsController;
use app\controllers\DashboardController;
define("APP_URL","http://localhost:8080/");
require_once __DIR__.'/vendor/autoload.php';
$dotenv = Dotenv\Dotenv::createImmutable(dirname(__DIR__.'/../'));
$dotenv->load();
$config=[
'db' => [
'dsn' => $_ENV['DB_DSN'],
'user' => $_ENV['DB_USER'],
'password' => $_ENV['DB_PASSWORD'],
]
];
$app = new Application(dirname((__DIR__.'/../')), $config);
$constats = new Constants();
$app->router->get('/dashboard', [DashboardController::class,'dashboard']);
$app->router->get('/getDailyDemands', [DashboardController::class,'getDailyDemands']);
$app->router->get('/getAppDemandCountList', [DashboardController::class,'getAppDemandCountList']);
$app->router->get('/getAppDemandStateCount', [DashboardController::class,'getAppDemandStateCount']);
$app->router->get('/apps', [AppsController::class,'index']);
$app->router->post('/apps/storeApp', [AppsController::class,'storeApp']);
$app->router->delete('/apps/destroyApp', [AppsController::class,'destroyApp']);
$app->router->get('/apps/editApp', [AppsController::class,'editApp']);
$app->router->get('/apps/createApp', [AppsController::class,'createApp']);
$app->router->post('/apps/updateApp', [AppsController::class,'updateApp']);
$app->router->get('/users', [UsersController::class,'index']);
$app->router->post('/users/storeUser', [UsersController::class,'storeUser']);
$app->router->delete('/users/destroyUser', [UsersController::class,'destroyUser']);
$app->router->get('/users/editUser', [UsersController::class,'editUser']);
$app->router->get('/users/createUser', [UsersController::class,'createUser']);
$app->router->post('/users/updateUser', [UsersController::class,'updateUser']);
$app->router->get('/users/changeUserPassword', [UsersController::class,'changeUserPassword']);
$app->router->post('/users/changePassword', [UsersController::class,'changePassword']);
$app->router->get('/demands', [DemandsController::class,'index']);
$app->router->get('/demands/getDemands', [DemandsController::class,'getDemands']);
$app->router->post('/demands/storeDemand', [DemandsController::class,'storeDemand']);
$app->router->delete('/demands/destroyDemand', [DemandsController::class,'destroyDemand']);
$app->router->get('/demands/editDemand', [DemandsController::class,'editDemand']);
$app->router->get('/demands/createDemand', [DemandsController::class,'createDemand']);
$app->router->post('/demands/updateDemand', [DemandsController::class,'updateDemand']);
$app->router->get('/demands/showDemand', [DemandsController::class,'showDemand']);
$app->router->post('/demands/changeStateDemand', [DemandsController::class,'changeStateDemand']);
$app->router->get('/', [DashboardController::class,'dashboard']);
$app->router->get('/auth/login', [AuthController::class,'login']);
$app->router->post('/auth/storeLogin', [AuthController::class,'storeLogin']);
$app->router->get('/auth/logout', [AuthController::class,'logout']);
$app->run();