From 654907f1de8885c8b695da62cd6af82586f4addd Mon Sep 17 00:00:00 2001 From: C Date: Tue, 28 Feb 2023 14:23:02 +0500 Subject: [PATCH] cors moved from config.js to allowed_cors.js, allowed_cors.js added to gitignore, allowed_cors.js added to README.md --- .gitignore | 2 ++ README.md | 10 +++++++++- config.js | 10 +--------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 6f92a01..5f24675 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,5 @@ dist .yarn/install-state.gz .pnp.* +# cors file +allowed_cors.js \ No newline at end of file diff --git a/README.md b/README.md index 71e61bc..544b7a3 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,12 @@ configure environment variables with .env file PORT= DATABASE_URL="" -DATABASE_NAME="" \ No newline at end of file +DATABASE_NAME="" + + +allowed_cors.js: + +module.exports = [ + "cors_domain_1", + "cors_domain_2" +] \ No newline at end of file diff --git a/config.js b/config.js index 01b4ccb..1e74497 100644 --- a/config.js +++ b/config.js @@ -5,15 +5,7 @@ module.exports = { database_url: process.env.DATABASE_URL, database_name: process.env.DATABASE_NAME, log_path: "./logs/runtime.log", - allowed_cors: [ - "http://192.168.1.171:3000", - "http://localhost:3000", - "https://stream.graff.tech/", - "http://212.220.216.185:3005", - "https://stream.graff.tech", - "http://test.stream.graff.tech", - "https://test.stream.graff.tech" - ], + allowed_cors: require('./allowed_cors'), limiter: { window_minutes: 10, max_requests_per_window: 1000