tuupola / cors-middleware

PSR-7 and PSR-15 CORS middleware
MIT License
132 stars 16 forks source link

How to use with php-di? #85

Open raizdev opened 1 year ago

raizdev commented 1 year ago

Question,

How to use this with PHP-DI for example?

return [ 'middlewares' => [ autowire(ErrorHandlingMiddleware::class), autowire(ClaimMiddleware::class) ]

I tried but i'm not able to set the options like this way

tuupola commented 1 year ago

I do not use PHP-DI but looking at the docs it seems like you need to use something called "definitions":

https://php-di.org/doc/autowiring.html https://php-di.org/doc/php-definitions.html