Cors not working #4986
Unanswered
viniusousa
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I setted up the cors but it's allowing all origins yet, i need to configure anything else?
`import type { CorsConfig } from '@IOC:Adonis/Core/Cors'
import Env from '@IOC:Adonis/Core/Env'
const corsConfig: CorsConfig = {
enabled: true,
origin: Env.get('FRONT_URL'),
methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
headers: true,
exposeHeaders: [
'cache-control',
'content-language',
'content-type',
'expires',
'last-modified',
'pragma',
],
credentials: true,
maxAge: 90,
}
export default corsConfig`
Beta Was this translation helpful? Give feedback.
All reactions