Skip to content

Commit

Permalink
update cors in nestjs
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel-Tyty committed Feb 11, 2025
1 parent 52fac02 commit e3f42f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 19 deletions.
7 changes: 6 additions & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ import { AppModule } from "./app.module";

async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors();
app.enableCors({
origin: "*",
methods: "GET,POST,OPTIONS",
allowedHeaders: "Authorization,Content-Type",
credentials: true,
});
await app.listen(3000);
}
bootstrap().then();
2 changes: 1 addition & 1 deletion charts/backend/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
traefik.ingress.kubernetes.io/router.middlewares: "traefik-redirect-http-to-https@kubernetescrd,traefik-default-headers@kubernetescrd,traefik-strip-prefix@kubernetescrd,cors-middleware"
traefik.ingress.kubernetes.io/router.middlewares: "traefik-redirect-http-to-https@kubernetescrd,traefik-default-headers@kubernetescrd,traefik-strip-prefix@kubernetescrd"
spec:
tls:
{{- range .Values.ingress.tls }}
Expand Down
17 changes: 0 additions & 17 deletions charts/backend/templates/middleware.yaml

This file was deleted.

0 comments on commit e3f42f8

Please sign in to comment.