strip api prefix middleware
All checks were successful
Deploy Backend / deploy (push) Successful in 1m40s

This commit is contained in:
Lee 2024-10-04 23:14:26 +01:00
parent 338f955c78
commit e5bfa8afa0
5 changed files with 15 additions and 2 deletions

@ -17,6 +17,8 @@ spec:
namespace: traefik namespace: traefik
- name: compress - name: compress
namespace: traefik namespace: traefik
- name: scoresaber-reloaded-backend-strip-api-prefix
namespace: public-services
services: services:
- name: scoresaber-reloaded-backend-service - name: scoresaber-reloaded-backend-service
port: 8080 port: 8080

@ -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"

@ -58,6 +58,7 @@ jobs:
manifests: | manifests: |
.gitea/kubernetes/backend/deployment.yaml .gitea/kubernetes/backend/deployment.yaml
.gitea/kubernetes/backend/service.yaml .gitea/kubernetes/backend/service.yaml
.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml
.gitea/kubernetes/backend/ingress.yaml .gitea/kubernetes/backend/ingress.yaml
images: | images: |
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }} git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}

@ -5,7 +5,7 @@ import { AppService } from "../service/app.service";
export class AppController { export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) {}
@Get() @Get("/")
getHello(): string { getHello(): string {
return this.appService.getHello(); return this.appService.getHello();
} }

@ -3,7 +3,7 @@ import { AppModule } from "./app.module";
async function bootstrap() { async function bootstrap() {
const app = await NestFactory.create(AppModule, { const app = await NestFactory.create(AppModule, {
logger: ["error", "warn"], logger: ["error", "warn", "log", "fatal"],
}); });
await app.listen(8080); await app.listen(8080);
} }