feat: add redirect from index route to graph.svg with query parameters
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Service\SvgRenderer;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\DependencyInjection\Attribute\Autowire;
|
||||
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
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'])]
|
||||
public function health(): Response
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user