Premier commit

This commit is contained in:
2024-09-09 10:22:45 +02:00
commit bcc2604080
74 changed files with 25819 additions and 0 deletions

22
lib/CorsMiddleware.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace app\lib;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
final class CorsMiddleware implements MiddlewareInterface
{
/**
* {@inheritDoc}
* @see \Psr\Http\Server\MiddlewareInterface::process()
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$response = $handler->handle($request);
return $response->withHeader('Access-Control-Allow-Origin', '*');
}
}