Skip to content

Commit 642f803

Browse files
committed
Switch to attribute routes
1 parent bcc01a2 commit 642f803

3 files changed

Lines changed: 6 additions & 24 deletions

File tree

config/routing.yaml

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Controller/HealthController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use OpenConext\MonitorBundle\HealthCheck\HealthCheckChain;
2222
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2323
use Symfony\Component\HttpFoundation\JsonResponse;
24+
use Symfony\Component\Routing\Attribute\Route;
2425

2526
/**
2627
* Display the health state of the application.
@@ -35,6 +36,8 @@ public function __construct(
3536
) {
3637
}
3738

39+
#[Route('/health', name: 'monitor.health', methods: ['GET'])]
40+
#[Route('/internal/health', name: 'monitor.internal_health', methods: ['GET'])]
3841
public function __invoke(): JsonResponse
3942
{
4043
$statusResponse = $this->healthChecker->check();

src/Controller/InfoController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
2424
use Symfony\Component\DependencyInjection\Attribute\Autowire;
2525
use Symfony\Component\HttpFoundation\JsonResponse;
26+
use Symfony\Component\Routing\Attribute\Route;
2627

2728
/**
2829
* Display specific information about the application.
@@ -65,6 +66,8 @@ public function __construct(
6566
}
6667
}
6768

69+
#[Route('/info', name: 'monitor.info', methods: ['GET'])]
70+
#[Route('/internal/info', name: 'monitor.internal_info', methods: ['GET'])]
6871
public function __invoke(): JsonResponse
6972
{
7073
$buildInformation = BuildInformationFactory::build(

0 commit comments

Comments
 (0)