forked from Lemon-Framework/app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit.php
More file actions
34 lines (23 loc) · 689 Bytes
/
Copy pathinit.php
File metadata and controls
34 lines (23 loc) · 689 Bytes
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
<?php
include __DIR__.'/vendor/autoload.php';
use Lemon\Http\Middlewares\Cors;
use Lemon\Kernel\Application;
use Lemon\Protection\Middlwares\Csrf;
$application = new Application(__DIR__);
// --- Loading default Lemon services ---
$application->loadServices();
// --- Loading Zests for services ---
$application->loadZests();
// --- Loading Error/Exception handlers ---
$application->loadHandler();
$application->get('config')->load();
/** @var \Lemon\Routing\Router $router */
$router = $application->get('routing');
$router->file('routes.web')
->middleware(Csrf::class)
;
$router->file('routes.api')
->prefix('api')
->middleware(Cors::class)
;
return $application;