load AWS config through app config; fix ENV path
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
"use strict";
|
||||||
|
require("dotenv").config({ path: __dirname + "/./../../.env" });
|
||||||
|
|
||||||
const APP_PORT = process.env.PORT || 5000;
|
const APP_PORT = process.env.PORT || 5000;
|
||||||
const APP_BASE_URL = process.env.APP_BASE_URL || "http://localhost";
|
const APP_BASE_URL = process.env.APP_BASE_URL || "http://localhost";
|
||||||
|
|
||||||
@@ -11,10 +14,24 @@ const DEFAULT_TIMEZONE = "Europe/Sarajevo";
|
|||||||
const CRAWLER_INTERVAL = parseInt(process.env.CRAWLER_INTERVAL) || 60;
|
const CRAWLER_INTERVAL = parseInt(process.env.CRAWLER_INTERVAL) || 60;
|
||||||
const STOP_CRAWLER = !!parseInt(process.env.STOP_CRAWLER);
|
const STOP_CRAWLER = !!parseInt(process.env.STOP_CRAWLER);
|
||||||
|
|
||||||
|
const AWS_EMAIL_CONFIG = {
|
||||||
|
REGION: process.env.AWS_REGION || "",
|
||||||
|
CREDENTIALS: {
|
||||||
|
ACCESS_KEY_ID: process.env.AWS_KEY_ID || "",
|
||||||
|
SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY || ""
|
||||||
|
},
|
||||||
|
SOURCE_EMAIL: process.env.SOURCE_EMAIL || ""
|
||||||
|
};
|
||||||
|
|
||||||
|
const MAX_REAL_ESTATES_IN_EMAIL =
|
||||||
|
parseInt(process.env.MAX_REAL_ESTATES_IN_EMAIL) || 10;
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
APP_PORT,
|
APP_PORT,
|
||||||
APP_URL,
|
APP_URL,
|
||||||
DEFAULT_TIMEZONE,
|
DEFAULT_TIMEZONE,
|
||||||
CRAWLER_INTERVAL,
|
CRAWLER_INTERVAL,
|
||||||
STOP_CRAWLER
|
STOP_CRAWLER,
|
||||||
|
AWS_EMAIL_CONFIG,
|
||||||
|
MAX_REAL_ESTATES_IN_EMAIL
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
require("dotenv").config({ path: "../../.env" });
|
require("dotenv").config({ path: __dirname + "/./../../.env" });
|
||||||
const { CRAWLER_AD_TYPE, AD_CATEGORY } = require("../common/enums");
|
const { CRAWLER_AD_TYPE, AD_CATEGORY } = require("../common/enums");
|
||||||
|
|
||||||
const olxCrawlerAdType =
|
const olxCrawlerAdType =
|
||||||
|
|||||||
@@ -8,9 +8,12 @@ SEQUELIZE_LOGGING=0- no sequelize logging, 1- log to the console
|
|||||||
PORT=Port for the app, defaults to 5000
|
PORT=Port for the app, defaults to 5000
|
||||||
APP_BASE_URL=base url for the app
|
APP_BASE_URL=base url for the app
|
||||||
|
|
||||||
AMAZON_ACCES_KEY_ID=(your-key-here)
|
MAX_REAL_ESTATES_IN_EMAIL=Number of real estates that will be shown in URL, others will be truncated and URL with full list will be shwon
|
||||||
AMAZON_SECRET_ACCESS_KEY=(your-key-here)
|
|
||||||
AMAZON_REGION=eu-west-1
|
AWS_KEY_ID=(your-key-here)
|
||||||
|
AWS_SECRET_ACCESS_KEY=(your-key-here)
|
||||||
|
AWS_REGION=eu-west-1
|
||||||
|
|
||||||
APP_URL=http://localhost:3001
|
APP_URL=http://localhost:3001
|
||||||
SOURCE_EMAIL=info@saburly.com
|
SOURCE_EMAIL=info@saburly.com
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user