beavuck-time 2.4.3 → 2.4.4
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/README.md +3 -7
- package/build/server.js +1 -14
- package/openapi/swagger.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,16 +89,12 @@ import { startServer } from 'beavuck-time'
|
|
|
89
89
|
startServer({
|
|
90
90
|
hostUrl: 'https://time-api.example.com',
|
|
91
91
|
trustedOrigins: 'https://my.app.com, https://my.app.com/*, https://my-other.app.com, https://my-other.app.com/*',
|
|
92
|
-
apiPort: 3000
|
|
93
|
-
rateLimit: -1,
|
|
94
|
-
logLevel: 'info',
|
|
95
|
-
maxLogFiles: 64,
|
|
96
|
-
maxSizeLogFiles: '1m',
|
|
92
|
+
apiPort: 3000
|
|
97
93
|
})
|
|
98
94
|
```
|
|
99
95
|
|
|
100
|
-
You can rely on environment variables (BEAVUCK_TIME_HOST_URL, etc.) instead of passing an options object.
|
|
101
|
-
the Docker Compose example below to see an exhaustive list of available environment variables and what they do.
|
|
96
|
+
You can rely on environment variables (BEAVUCK_TIME_HOST_URL, etc.) together with (or instead of) passing an options object.
|
|
97
|
+
Refer to the Docker Compose example below to see an exhaustive list of available environment variables and what they do.
|
|
102
98
|
|
|
103
99
|
#### CLI
|
|
104
100
|
|
package/build/server.js
CHANGED
|
@@ -49,11 +49,7 @@ function startServer(options = {}) {
|
|
|
49
49
|
return server;
|
|
50
50
|
}
|
|
51
51
|
function manageEnvVars(options) {
|
|
52
|
-
|
|
53
|
-
options.logLevel === undefined ? 'info' : process.env.BEAVUCK_TIME_LOG_LEVEL;
|
|
54
|
-
logger_1.logger.level = process.env.BEAVUCK_TIME_LOG_LEVEL;
|
|
55
|
-
logger_1.logger.debug('LOG_LEVEL: ' + process.env.BEAVUCK_TIME_LOG_LEVEL);
|
|
56
|
-
logger_1.logger.debug('serverOptions: ' + JSON.stringify(options));
|
|
52
|
+
logger_1.logger.info('serverOptions: ' + JSON.stringify(options));
|
|
57
53
|
process.env.BEAVUCK_TIME_API_PORT =
|
|
58
54
|
options.apiPort === undefined ? '3000' : String(options.apiPort);
|
|
59
55
|
logger_1.logger.debug('API_PORT: ' + process.env.BEAVUCK_TIME_API_PORT);
|
|
@@ -63,15 +59,6 @@ function manageEnvVars(options) {
|
|
|
63
59
|
process.env.BEAVUCK_TIME_TRUSTED_ORIGINS =
|
|
64
60
|
options.trustedOrigins ?? process.env.BEAVUCK_TIME_TRUSTED_ORIGINS;
|
|
65
61
|
logger_1.logger.debug('TRUSTED_ORIGINS: ' + process.env.BEAVUCK_TIME_TRUSTED_ORIGINS);
|
|
66
|
-
process.env.BEAVUCK_TIME_RATE_LIMIT =
|
|
67
|
-
options.rateLimit === undefined ? process.env.BEAVUCK_TIME_RATE_LIMIT : String(options.rateLimit);
|
|
68
|
-
logger_1.logger.debug('RATE_LIMIT: ' + process.env.BEAVUCK_TIME_RATE_LIMIT);
|
|
69
|
-
process.env.BEAVUCK_TIME_MAX_LOG_FILES =
|
|
70
|
-
options.maxLogFiles === undefined ? process.env.BEAVUCK_TIME_MAX_LOG_FILES : String(options.maxLogFiles);
|
|
71
|
-
logger_1.logger.debug('MAX_LOG_FILES: ' + process.env.BEAVUCK_TIME_MAX_LOG_FILES);
|
|
72
|
-
process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES =
|
|
73
|
-
options.maxSizeLogFiles ?? process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES;
|
|
74
|
-
logger_1.logger.debug('MAX_SIZE_LOG_FILES: ' + process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES);
|
|
75
62
|
validateEnv();
|
|
76
63
|
}
|
|
77
64
|
function validateEnv() {
|
package/openapi/swagger.json
CHANGED