feat: add redirect from index route to graph.svg with query parameters

This commit is contained in:
2026-05-29 18:28:56 +02:00
parent b3e79de069
commit 8b8ec9ab2f
+10
View File
@@ -7,6 +7,7 @@ use App\Service\SvgRenderer;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\DependencyInjection\Attribute\Autowire;
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
@@ -56,6 +57,15 @@ class GraphController
]); ]);
} }
#[Route('/', name: 'index', methods: ['GET'])]
public function index(Request $request): RedirectResponse
{
$query = $request->query->all();
$url = '/graph.svg' . ($query ? '?' . http_build_query($query) : '');
return new RedirectResponse($url, 302);
}
#[Route('/health', name: 'health', methods: ['GET'])] #[Route('/health', name: 'health', methods: ['GET'])]
public function health(): Response public function health(): Response
{ {