mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-07 15:31:00 +08:00
feat: redirect /api to api docs
This commit is contained in:
parent
03f48a6eae
commit
320e1c5be8
@ -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()) {
|
||||
|
@ -21,7 +21,7 @@ ingress:
|
||||
- path: /
|
||||
pathType: ImplementationSpecific
|
||||
target: frontend
|
||||
- path: /api/
|
||||
- path: /api
|
||||
pathType: ImplementationSpecific
|
||||
target: backend
|
||||
- path: /v3/api-docs
|
||||
|
Loading…
Reference in New Issue
Block a user