fix cors
This commit is contained in:
@@ -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: [],
|
||||
|
||||
Reference in New Issue
Block a user