Improved middleware pipeline and added cross-domain headers for ajax requests

This commit is contained in:
Alejandro Celaya
2016-07-03 08:40:39 +02:00
parent 4129d35447
commit 67ef171262
4 changed files with 68 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
<?php
use Acelaya\UrlShortener\Middleware;
use Zend\Expressive\Container\ApplicationFactory;
use Zend\Expressive\Helper;
@@ -15,6 +16,20 @@ return [
'routing' => [
'middleware' => [
ApplicationFactory::ROUTING_MIDDLEWARE,
],
'priority' => 10,
],
'rest' => [
'path' => '/rest',
'middleware' => [
Middleware\CrossDomainMiddleware::class,
],
'priority' => 5,
],
'post-routing' => [
'middleware' => [
Helper\UrlHelperMiddleware::class,
ApplicationFactory::DISPATCH_MIDDLEWARE,
],