mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-24 08:00:13 -06:00
69 lines
1.7 KiB
PHP
69 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Shlinkio\Shlink;
|
|
|
|
use Laminas\Stratigility\Middleware\ErrorHandler;
|
|
use Mezzio;
|
|
use Mezzio\ProblemDetails;
|
|
|
|
return [
|
|
|
|
'middleware_pipeline' => [
|
|
'error-handler' => [
|
|
'middleware' => [
|
|
Mezzio\Helper\ContentLengthMiddleware::class,
|
|
ErrorHandler::class,
|
|
],
|
|
],
|
|
'error-handler-rest' => [
|
|
'path' => '/rest',
|
|
'middleware' => [
|
|
Rest\Middleware\CrossDomainMiddleware::class,
|
|
ProblemDetails\ProblemDetailsMiddleware::class,
|
|
],
|
|
],
|
|
|
|
'pre-routing' => [
|
|
'middleware' => [
|
|
Common\Middleware\CloseDbConnectionMiddleware::class,
|
|
],
|
|
],
|
|
|
|
'routing' => [
|
|
'middleware' => [
|
|
Mezzio\Router\Middleware\RouteMiddleware::class,
|
|
],
|
|
],
|
|
|
|
'rest' => [
|
|
'path' => '/rest',
|
|
'middleware' => [
|
|
Mezzio\Router\Middleware\ImplicitOptionsMiddleware::class,
|
|
Rest\Middleware\BodyParserMiddleware::class,
|
|
Rest\Middleware\AuthenticationMiddleware::class,
|
|
],
|
|
],
|
|
|
|
'dispatch' => [
|
|
'middleware' => [
|
|
Mezzio\Router\Middleware\DispatchMiddleware::class,
|
|
],
|
|
],
|
|
|
|
'not-found-rest' => [
|
|
'path' => '/rest',
|
|
'middleware' => [
|
|
ProblemDetails\ProblemDetailsNotFoundHandler::class,
|
|
],
|
|
],
|
|
'not-found' => [
|
|
'middleware' => [
|
|
Core\ErrorHandler\NotFoundRedirectHandler::class,
|
|
Core\ErrorHandler\NotFoundTemplateHandler::class,
|
|
],
|
|
],
|
|
],
|
|
];
|