app_template/lib/Controller/ApiController.php
Michel Roux 62f793e748
All checks were successful
app_template / xml (push) Successful in 11s
app_template / php (push) Successful in 1m7s
app_template / nodejs (push) Successful in 1m1s
app_template / release (push) Has been skipped
make my own changes
2024-11-10 17:08:22 +01:00

30 lines
634 B
PHP

<?php
declare(strict_types=1);
namespace OCA\AppTemplate\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\ApiRoute;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
class ApiController extends OCSController
{
/**
* An example API endpoint.
*
* @return DataResponse<Http::STATUS_OK, array{message: string}, array{}>
*
* 200: Data returned
*/
#[NoAdminRequired]
#[ApiRoute(verb: 'GET', url: '/api')]
public function index(): DataResponse {
return new DataResponse(
['message' => 'Hello world!']
);
}
}