20 lines
		
	
	
	
		
			488 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			488 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { defineConfig } from '@adonisjs/cors'
 | |
| 
 | |
| /**
 | |
|  * Configuration options to tweak the CORS policy. The following
 | |
|  * options are documented on the official documentation website.
 | |
|  *
 | |
|  * https://docs.adonisjs.com/guides/security/cors
 | |
|  */
 | |
| const corsConfig = defineConfig({
 | |
|   enabled: true,
 | |
|   // TODO: Only same domain
 | |
|   origin: '*',
 | |
|   methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
 | |
|   headers: true,
 | |
|   exposeHeaders: [],
 | |
|   credentials: true,
 | |
|   maxAge: 90,
 | |
| })
 | |
| 
 | |
| export default corsConfig
 | 
