feat: redirect /api to api docs

This commit is contained in:
MiniDigger | Martin 2024-12-02 10:06:52 +01:00
parent 03f48a6eae
commit 320e1c5be8
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,12 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class ApplicationController extends HangarComponent {
@GetMapping(path = "/api")
public void apiRootRedirect() {
this.response.setStatus(301);
this.response.setHeader("Location", "/api-docs");
}
@GetMapping(path = "/robots.txt", produces = MediaType.TEXT_PLAIN_VALUE)
public String robots() {
if (!this.config.isAllowIndexing()) {

View File

@ -21,7 +21,7 @@ ingress:
- path: /
pathType: ImplementationSpecific
target: frontend
- path: /api/
- path: /api
pathType: ImplementationSpecific
target: backend
- path: /v3/api-docs