Skip to content

Commit 4b388b0

Browse files
committed
Add /v1 - /v2 redirect controller
1 parent b0f5963 commit 4b388b0

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
## [2.0.1] - 2024-04-09
8+
- [#201](https://github.com/os2display/display-api-service/pull/201)
9+
- Add /v1 - /v2 redirect controller
10+
711
## [2.0.0] - 2024-04-09
812

913
- [#199](https://github.com/os2display/display-api-service/pull/199)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace App\Controller;
4+
5+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6+
use Symfony\Component\HttpFoundation\RedirectResponse;
7+
use Symfony\Component\Routing\Attribute\Route;
8+
9+
class ApiV1RedirectController extends AbstractController
10+
{
11+
#[Route('/v1/{endpoint}', name: 'app_api_v1_redirect', requirements: ['endpoint' => '.+'], defaults: ['endpoint' => null], methods: ['GET'])]
12+
public function index(string $endpoint): RedirectResponse
13+
{
14+
return $this->redirect('/v2'.$endpoint, 301);
15+
}
16+
}

0 commit comments

Comments
 (0)