Added the files from MVP
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace routes;
|
||||
|
||||
use traits\route_t;
|
||||
|
||||
class optionsRoute
|
||||
{
|
||||
use route_t;
|
||||
|
||||
public function run(): void
|
||||
{
|
||||
// When the OPTIONS method is requested, accept all using regex
|
||||
$this->options('/.*', function () {
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: *');
|
||||
header('Content-Type: application/json');
|
||||
http_response_code(200);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user