71 lines
2.7 KiB
PHP
71 lines
2.7 KiB
PHP
<?php
|
|
|
|
use Ulmus\ConnectionAdapter;
|
|
|
|
use function DI\{ get, env };
|
|
|
|
define('LEAN_API_PROJECT_PATH', dirname(__DIR__, 2));
|
|
|
|
return [
|
|
'lean.api' => [
|
|
'picea' => [
|
|
'context' => Lean\Api\View::class,
|
|
|
|
'view' => [
|
|
[
|
|
'path' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH , "view", '' ]),
|
|
'order' => 99,
|
|
],
|
|
],
|
|
|
|
'asset' => [
|
|
[
|
|
'path' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, "asset", '' ]),
|
|
'order' => 10
|
|
],
|
|
],
|
|
],
|
|
|
|
'cli' => [
|
|
'Lean\\Api\\Cli' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, "src", "Cli", "" ]),
|
|
],
|
|
|
|
'cronard' => [
|
|
'Lean\\Api\\Cronard' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, 'src', 'Cronard', '' ]),
|
|
],
|
|
|
|
'ulmus' => [
|
|
'entities' => [ 'Lean\\Api\\Entity' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, 'src', 'Entity', '' ]) ],
|
|
'adapters' => [
|
|
DI\get('lean.api:storage'),
|
|
]
|
|
],
|
|
|
|
'tell' => [
|
|
'json' => [
|
|
[
|
|
'path' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, "meta", "i18n", "" ]),
|
|
'order' => 99,
|
|
],
|
|
]
|
|
],
|
|
|
|
'routes' => [
|
|
'Lean\\Api\\Controller' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, "src", "Controller", "" ]),
|
|
] + (getenv('DEBUG') ? [
|
|
'Lean\\Api\\Cronard' => implode(DIRECTORY_SEPARATOR, [ LEAN_API_PROJECT_PATH, 'src', 'Cronard', '' ]),
|
|
]: []),
|
|
],
|
|
|
|
'app.middlewares' => \DI\add([
|
|
# Lean\Api\Middleware\Security\CORSMiddleware::class,
|
|
# Lean\Api\Middleware\Security\RequestLogMiddleware::class,
|
|
]),
|
|
|
|
Lean\ApplicationStrategy\NotFoundDecoratorInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\NotFoundDecorator::class),
|
|
Lean\ApplicationStrategy\MethodNotAllowedInterface::class => DI\autowire(Lean\Api\ApplicationStrategy\MethodNotAllowedDecorator::class),
|
|
Lean\Api\Factory\MessageFactoryInterface::class => DI\autowire(Lean\Api\Lib\Message::class),
|
|
Lean\Api\Factory\LeanApiFormFactoryInterface::class => DI\autowire(Lean\Api\Factory\LeanApiFormFactory::class),
|
|
Lean\Api\Lib\RenderCORS::class => DI\create(Lean\Api\Lib\RenderCORS::class)->constructor(get(\Psr\Http\Message\ServerRequestInterface::class), env('LEAN_API_CORS_ORIGIN', '*')),
|
|
# League\Route\Strategy\ApplicationStrategy::class => DI\autowire(Lean\Api\ApplicationStrategy::class),
|
|
]; |