Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Latest commit

 

History

History
25 lines (16 loc) · 528 Bytes

instructions.md

File metadata and controls

25 lines (16 loc) · 528 Bytes

Register provider

Start by registering the provider inside start/app.js file.

const providers = [
  '@adonisjs/cors/providers/CorsProvider'
]

Register middleware

The next thing is to register the middleware globally. Make sure Cors middleware is the first middleware in the stack.

The middleware is registered inside start/kernel.js file.

Server
  .use(['Adonis/Middleware/Cors'])

Config

The config file has been saved inside config/cors.js file. Feel free to tweak it accordingly.