This commit is contained in:
Rutra
2026-05-13 13:15:24 +02:00
parent 2068229f89
commit b7284d4abd
4 changed files with 5 additions and 3 deletions

View File

@@ -1,8 +1,9 @@
import env from '#start/env';
import app from '@adonisjs/core/services/app';
import { defineConfig } from '@adonisjs/cors';
const corsConfig = defineConfig({
enabled: true,
origin: app.inDev ? true : [],
origin: app.inDev || env.get('CORS_ORIGIN') === 'all' ? true : [env.get('CORS_ORIGIN')],
methods: ['GET', 'HEAD', 'POST', 'PUT', 'PATCH', 'DELETE'],
headers: true,
exposeHeaders: [],