Initial code to hopefully implement API for future WebGUI projects.

This commit is contained in:
abdulmohsen
2024-03-02 21:59:56 +03:00
parent 56d7b9ff10
commit 5bf03a321b
11 changed files with 637 additions and 141 deletions

View File

@@ -9,15 +9,13 @@ use App\Libs\HTTP_STATUS;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
#[Post(pattern: self::URL)]
#[Post(self::URL, name: 'backends.create')]
final class Create
{
public const URL = '/api/backends';
public const URL = '%{api.prefix}/backends';
public function __invoke(ServerRequestInterface $request, array $args = []): ResponseInterface
{
return api_response([
'message' => 'Create'
], HTTP_STATUS::HTTP_OK);
return api_error('Not yet implemented', HTTP_STATUS::HTTP_SERVICE_UNAVAILABLE);
}
}