-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroutes.php
44 lines (34 loc) · 1.13 KB
/
routes.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
<?php
use Buki\Router\Router;
$router = new Router([
'paths' => [
'controllers' => 'Controllers',
],
'namespace' => [
'controllers' => 'Controllers',
]
]);
$router->get('/', function() {
return ['code' => '400', 'msg' => 'Route not served'];
});
// Setup endpoints
$router->group('api-v2', function($router) {
$router->get('/create', 'ApiController@create');
$router->get('/seed', 'ApiController@seed');
$router->get('/clear', 'ApiController@clear');
$router->get('/search', 'ApiController@search');
// Data endpoints
$router->get('/ranking', 'DataController@ranking');
$router->get('/universities', 'DataController@universities');
$router->get('/col', 'DataController@costOfLiving');
$router->get('/themes', 'DataController@themes');
});
$router->group('admin', function($router) {
// Upload new pdf
$router->post('/upload', 'AdminController@upload');
$router->get('/diff', 'AdminController@diff');
$router->get('/table', 'AdminController@table');
});
$router->get('/epitech/login', 'EpitechController@login');
$router->run();
?>