beavuck-time 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/config/corsOptions.js +5 -1
- package/build/config/logger.js +2 -0
- package/build/server.js +8 -0
- package/openapi/swagger.json +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,11 @@ const corsError_1 = require("../errors/corsError");
|
|
|
15
15
|
const urlUtil_1 = require("../utils/urlUtil");
|
|
16
16
|
const http_status_codes_1 = require("http-status-codes");
|
|
17
17
|
const dotenvx_1 = __importDefault(require("@dotenvx/dotenvx"));
|
|
18
|
-
|
|
18
|
+
// Load environment variables from .env file, if available
|
|
19
|
+
// but don't error if the file is missing
|
|
20
|
+
dotenvx_1.default.config({
|
|
21
|
+
ignore: ['MISSING_ENV_FILE'],
|
|
22
|
+
});
|
|
19
23
|
exports.corsOptions = {
|
|
20
24
|
methods: ['GET', 'OPTIONS'],
|
|
21
25
|
optionsSuccessStatus: http_status_codes_1.StatusCodes.OK,
|
package/build/config/logger.js
CHANGED
|
@@ -8,6 +8,8 @@ exports.logger = void 0;
|
|
|
8
8
|
const winston_1 = require("winston");
|
|
9
9
|
require("winston-daily-rotate-file");
|
|
10
10
|
const dotenvx_1 = __importDefault(require("@dotenvx/dotenvx"));
|
|
11
|
+
// Load environment variables from .env file, if available
|
|
12
|
+
// but don't error if the file is missing
|
|
11
13
|
dotenvx_1.default.config({
|
|
12
14
|
ignore: ['MISSING_ENV_FILE'],
|
|
13
15
|
});
|
package/build/server.js
CHANGED
|
@@ -49,26 +49,34 @@ function startServer(options = {}) {
|
|
|
49
49
|
return server;
|
|
50
50
|
}
|
|
51
51
|
function manageEnvVars(options) {
|
|
52
|
+
logger_1.logger.debug('serverOptions: ' + JSON.stringify(options));
|
|
52
53
|
process.env.BEAVUCK_TIME_API_PORT =
|
|
53
54
|
options.apiPort === undefined
|
|
54
55
|
? '3000'
|
|
55
56
|
: String(options.apiPort);
|
|
57
|
+
logger_1.logger.debug('API_PORT: ' + process.env.BEAVUCK_TIME_API_PORT);
|
|
56
58
|
process.env.BEAVUCK_TIME_HOST_URL =
|
|
57
59
|
options.hostUrl ?? process.env.BEAVUCK_TIME_HOST_URL;
|
|
60
|
+
logger_1.logger.debug('HOST_URL: ' + process.env.BEAVUCK_TIME_HOST_URL);
|
|
58
61
|
process.env.BEAVUCK_TIME_TRUSTED_ORIGINS =
|
|
59
62
|
options.trustedOrigins ?? process.env.BEAVUCK_TIME_TRUSTED_ORIGINS;
|
|
63
|
+
logger_1.logger.debug('TRUSTED_ORIGINS: ' + process.env.BEAVUCK_TIME_TRUSTED_ORIGINS);
|
|
60
64
|
process.env.BEAVUCK_TIME_RATE_LIMIT =
|
|
61
65
|
options.rateLimit === undefined
|
|
62
66
|
? process.env.BEAVUCK_TIME_RATE_LIMIT
|
|
63
67
|
: String(options.rateLimit);
|
|
68
|
+
logger_1.logger.debug('RATE_LIMIT: ' + process.env.BEAVUCK_TIME_RATE_LIMIT);
|
|
64
69
|
process.env.BEAVUCK_TIME_LOG_LEVEL =
|
|
65
70
|
options.logLevel ?? process.env.BEAVUCK_TIME_LOG_LEVEL;
|
|
71
|
+
logger_1.logger.debug('LOG_LEVEL: ' + process.env.BEAVUCK_TIME_LOG_LEVEL);
|
|
66
72
|
process.env.BEAVUCK_TIME_MAX_LOG_FILES =
|
|
67
73
|
options.maxLogFiles === undefined
|
|
68
74
|
? process.env.BEAVUCK_TIME_MAX_LOG_FILES
|
|
69
75
|
: String(options.maxLogFiles);
|
|
76
|
+
logger_1.logger.debug('MAX_LOG_FILES: ' + process.env.BEAVUCK_TIME_MAX_LOG_FILES);
|
|
70
77
|
process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES =
|
|
71
78
|
options.maxSizeLogFiles ?? process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES;
|
|
79
|
+
logger_1.logger.debug('MAX_SIZE_LOG_FILES: ' + process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES);
|
|
72
80
|
validateEnv();
|
|
73
81
|
}
|
|
74
82
|
function validateEnv() {
|
package/openapi/swagger.json
CHANGED