Skip to content

Commit

Permalink
feat: redirect /api to api docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniDigger committed Dec 2, 2024
1 parent 03f48a6 commit 320e1c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
@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()) {
Expand Down
2 changes: 1 addition & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ingress:
- path: /
pathType: ImplementationSpecific
target: frontend
- path: /api/
- path: /api
pathType: ImplementationSpecific
target: backend
- path: /v3/api-docs
Expand Down

0 comments on commit 320e1c5

Please sign in to comment.