Skip to content

Commit

Permalink
fix(configs): allow origins arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Aug 9, 2022
1 parent ac19ce6 commit 6797732
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ import { isDev } from "./utils/environment.utils";
console.log(argv);
export const PORT = argv.port || 3333;
export const CROSS_DOMAIN = {
allowedOrigins: [
"innei.ren",
"shizuri.net",
"localhost:9528",
"localhost:2323",
"localhost:2222",
"127.0.0.1",
"mbp.cc",
"local.innei.test",
"22333322.xyz",
"localhost:3000",
],
allowedOrigins: argv.allowed_origins
? argv.allowed_origins?.split?.(',')
: [
"iucky.cn",
"blog.iucky.cn",
"localhost:9528",
"localhost:2323",
"localhost:2222",
"127.0.0.1",
"mbp.cc",
"local.innei.test",
"22333322.xyz",
"localhost:3000",
],
allowedReferer: "innei.ren",
};

Expand All @@ -32,9 +34,8 @@ export const MONGO_DB = {
? `${argv.db_user}:${argv.db_password}@`
: "",
get uri() {
return `mongodb://${this.userAndPassword}${this.host}:${this.port}${
argv.railway ? "" : `/${this.dbName}`
}`;
return `mongodb://${this.userAndPassword}${this.host}:${this.port}${argv.railway ? "" : `/${this.dbName}`
}`;
},
};

Expand Down

0 comments on commit 6797732

Please sign in to comment.