Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2021-07-05 00:08:24 +02:00
parent cc049e675a
commit 7707b426aa

View File

@@ -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');
},
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------