Re-factored the routing to support API in the future.
This commit is contained in:
23
src/API/Backends/Create.php
Normal file
23
src/API/Backends/Create.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\API\Backends;
|
||||
|
||||
use App\Libs\Attributes\Route\Post;
|
||||
use App\Libs\HTTP_STATUS;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
#[Post(pattern: self::URL)]
|
||||
final class Create
|
||||
{
|
||||
public const URL = '/api/backends';
|
||||
|
||||
public function __invoke(ServerRequestInterface $request, array $args = []): ResponseInterface
|
||||
{
|
||||
return api_response([
|
||||
'message' => 'Create'
|
||||
], HTTP_STATUS::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user