2016-04-10 02:38:07 -05:00
|
|
|
<?php
|
2017-10-12 03:13:20 -05:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2017-03-24 15:10:25 -05:00
|
|
|
use Shlinkio\Shlink\Common\Middleware\LocaleMiddleware;
|
|
|
|
use Shlinkio\Shlink\Rest\Middleware\BodyParserMiddleware;
|
|
|
|
use Shlinkio\Shlink\Rest\Middleware\CheckAuthenticationMiddleware;
|
|
|
|
use Shlinkio\Shlink\Rest\Middleware\CrossDomainMiddleware;
|
|
|
|
use Shlinkio\Shlink\Rest\Middleware\PathVersionMiddleware;
|
2017-04-13 02:43:11 -05:00
|
|
|
use Zend\Expressive;
|
2017-03-24 15:10:25 -05:00
|
|
|
use Zend\Stratigility\Middleware\ErrorHandler;
|
2016-04-10 02:38:07 -05:00
|
|
|
|
|
|
|
return [
|
2016-04-17 12:34:16 -05:00
|
|
|
|
2016-04-10 02:38:07 -05:00
|
|
|
'middleware_pipeline' => [
|
2017-03-24 15:10:25 -05:00
|
|
|
'pre-routing' => [
|
|
|
|
'middleware' => [
|
|
|
|
ErrorHandler::class,
|
|
|
|
LocaleMiddleware::class,
|
|
|
|
],
|
|
|
|
'priority' => 11,
|
|
|
|
],
|
|
|
|
'pre-routing-rest' => [
|
|
|
|
'path' => '/rest',
|
|
|
|
'middleware' => [
|
|
|
|
PathVersionMiddleware::class,
|
|
|
|
],
|
|
|
|
'priority' => 11,
|
|
|
|
],
|
|
|
|
|
2016-04-10 02:38:07 -05:00
|
|
|
'routing' => [
|
|
|
|
'middleware' => [
|
2017-04-13 02:43:11 -05:00
|
|
|
Expressive\Application::ROUTING_MIDDLEWARE,
|
2016-07-03 01:40:39 -05:00
|
|
|
],
|
|
|
|
'priority' => 10,
|
|
|
|
],
|
|
|
|
|
2017-03-24 15:10:25 -05:00
|
|
|
'rest' => [
|
|
|
|
'path' => '/rest',
|
|
|
|
'middleware' => [
|
|
|
|
CrossDomainMiddleware::class,
|
2017-04-13 02:43:11 -05:00
|
|
|
Expressive\Middleware\ImplicitOptionsMiddleware::class,
|
2017-03-24 15:10:25 -05:00
|
|
|
BodyParserMiddleware::class,
|
|
|
|
CheckAuthenticationMiddleware::class,
|
|
|
|
],
|
|
|
|
'priority' => 5,
|
|
|
|
],
|
|
|
|
|
2016-07-03 01:40:39 -05:00
|
|
|
'post-routing' => [
|
|
|
|
'middleware' => [
|
2017-04-13 02:43:11 -05:00
|
|
|
Expressive\Application::DISPATCH_MIDDLEWARE,
|
2016-04-10 02:38:07 -05:00
|
|
|
],
|
|
|
|
'priority' => 1,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
];
|