diff --git a/.gitea/kubernetes/backend/ingress.yaml b/.gitea/kubernetes/backend/ingress.yaml index 36563f2..2de160a 100644 --- a/.gitea/kubernetes/backend/ingress.yaml +++ b/.gitea/kubernetes/backend/ingress.yaml @@ -17,6 +17,8 @@ spec: namespace: traefik - name: compress namespace: traefik + - name: scoresaber-reloaded-backend-strip-api-prefix + namespace: public-services services: - name: scoresaber-reloaded-backend-service port: 8080 diff --git a/.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml b/.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml new file mode 100644 index 0000000..19f113b --- /dev/null +++ b/.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml @@ -0,0 +1,10 @@ +--- +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: scoresaber-reloaded-backend-strip-api-prefix + namespace: public-services +spec: + stripPrefix: + prefixes: + - "/api" diff --git a/.gitea/workflows/deploy-backend.yml b/.gitea/workflows/deploy-backend.yml index d77a3ee..8b6a85f 100644 --- a/.gitea/workflows/deploy-backend.yml +++ b/.gitea/workflows/deploy-backend.yml @@ -58,6 +58,7 @@ jobs: manifests: | .gitea/kubernetes/backend/deployment.yaml .gitea/kubernetes/backend/service.yaml + .gitea/kubernetes/backend/strip-api-prefix-middleware.yaml .gitea/kubernetes/backend/ingress.yaml images: | git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} diff --git a/backend/src/controller/app.controller.ts b/backend/src/controller/app.controller.ts index 8e8a071..6b01dc2 100644 --- a/backend/src/controller/app.controller.ts +++ b/backend/src/controller/app.controller.ts @@ -5,7 +5,7 @@ import { AppService } from "../service/app.service"; export class AppController { constructor(private readonly appService: AppService) {} - @Get() + @Get("/") getHello(): string { return this.appService.getHello(); } diff --git a/backend/src/main.ts b/backend/src/main.ts index c801e34..525b536 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -3,7 +3,7 @@ import { AppModule } from "./app.module"; async function bootstrap() { const app = await NestFactory.create(AppModule, { - logger: ["error", "warn"], + logger: ["error", "warn", "log", "fatal"], }); await app.listen(8080); }