This repository was archived by the owner on Jun 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class APIClient<Ready extends boolean = boolean> {
3737
3838 this . _express . use ( bodyParser . urlencoded ( { extended : false } ) ) ;
3939 this . _express . use ( bodyParser . json ( ) ) ;
40- this . _express . use ( cors ( { origin : "*" } ) ) ;
40+ this . _express . use ( cors ( this . kirin . config . api . cors ) ) ;
4141
4242 await this . loadRoutes ( ) ;
4343
Original file line number Diff line number Diff line change 1+ import { CorsOptions , CorsOptionsDelegate } from 'cors' ;
12import { BaseMessageOptions , PermissionResolvable , inlineCode } from 'discord.js' ;
23import { createReadFile } from 'fallout-utility' ;
34import { writeFileSync } from 'fs' ;
@@ -11,6 +12,7 @@ export interface Config {
1112 enabled : boolean ;
1213 port : number ;
1314 password : string | null ;
15+ cors : CorsOptions | CorsOptionsDelegate ;
1416 } ;
1517 command : {
1618 enabled : boolean ;
@@ -38,7 +40,8 @@ export const defaultConfig: Config = {
3840 api : {
3941 enabled : false ,
4042 port : 55667 ,
41- password : null
43+ password : null ,
44+ cors : { origin : '*' }
4245 } ,
4346 command : {
4447 enabled : true ,
You can’t perform that action at this time.
0 commit comments