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

View File

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

View File

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

View File

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

View File

@ -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();
}

View File

@ -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);
}