Initial commit
This commit is contained in:
20
src/Controller/SiteController.php
Normal file
20
src/Controller/SiteController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Site;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
class SiteController extends AbstractController
|
||||
{
|
||||
#[Route('/site/{id<\d+>}', name: 'app_site')]
|
||||
public function index(Site $site): JsonResponse
|
||||
{
|
||||
return $this->json([
|
||||
'message' => 'Request successful',
|
||||
'site' => $site,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user