mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-30 19:37:51 +01:00
@@ -5,7 +5,7 @@
|
|||||||
* file.
|
* file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { CorsConfig } from '@ioc:Adonis/Core/Cors'
|
import {CorsConfig} from '@ioc:Adonis/Core/Cors'
|
||||||
|
|
||||||
const corsConfig: CorsConfig = {
|
const corsConfig: CorsConfig = {
|
||||||
/*
|
/*
|
||||||
@@ -44,15 +44,7 @@ const corsConfig: CorsConfig = {
|
|||||||
| one of the above values.
|
| one of the above values.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
origin: (origin) => {
|
origin: '*',
|
||||||
// Allow all connection on dev mode
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Production : allow only from your domain
|
|
||||||
return origin.includes('arthurdanjou.fr');
|
|
||||||
},
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user