Skip to content

Commit

Permalink
add cors to env
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoerlitz committed Jun 26, 2023
1 parent ec32094 commit 914ac2f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ initializeApplication()
application.use(
cors({
credentials: true,
origin: "https://tc-dev.vatsim-germany.org",
origin: Config.APP_CORS_ALLOW,
})
);
application.use(cookieParser(Config.APP_KEY));
Expand Down
2 changes: 2 additions & 0 deletions src/core/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const required_env: Array<string> = [
"APP_PORT",
"APP_KEY",
"APP_HOST",
"APP_CORS_ALLOW",
"SESSION_COOKIE_NAME",
"VATSIM_API_BASE",
"VATGER_API_BASE",
Expand Down Expand Up @@ -45,6 +46,7 @@ export const Config = {
// Read from .env
APP_DEBUG: process.env.APP_DEBUG?.toLowerCase() == "true",
APP_LOG_SQL: process.env.APP_LOG_SQL?.toLowerCase() == "true",
APP_CORS_ALLOW: process.env.APP_CORS_ALLOW,

APP_KEY: process.env.APP_KEY,
APP_PORT: Number(process.env.APP_PORT),
Expand Down

0 comments on commit 914ac2f

Please sign in to comment.