beavuck-time 2.4.2 → 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 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. Refer to
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
 
@@ -65,5 +65,5 @@ function isAllTrusted() {
65
65
  function isOriginAbsentOrTrusted(origin) {
66
66
  return (!origin ||
67
67
  getTrustedOrigins().includes(origin) ||
68
- getTrustedOrigins().some(to => to.includes('/*') && origin.startsWith(to)));
68
+ getTrustedOrigins().some(to => origin.startsWith(to.replace('/*', ''))));
69
69
  }
package/build/server.js CHANGED
@@ -49,11 +49,9 @@ function startServer(options = {}) {
49
49
  return server;
50
50
  }
51
51
  function manageEnvVars(options) {
52
- logger_1.logger.debug('serverOptions: ' + JSON.stringify(options));
52
+ logger_1.logger.info('serverOptions: ' + JSON.stringify(options));
53
53
  process.env.BEAVUCK_TIME_API_PORT =
54
- options.apiPort === undefined
55
- ? '3000'
56
- : String(options.apiPort);
54
+ options.apiPort === undefined ? '3000' : String(options.apiPort);
57
55
  logger_1.logger.debug('API_PORT: ' + process.env.BEAVUCK_TIME_API_PORT);
58
56
  process.env.BEAVUCK_TIME_HOST_URL =
59
57
  options.hostUrl ?? process.env.BEAVUCK_TIME_HOST_URL;
@@ -61,22 +59,6 @@ function manageEnvVars(options) {
61
59
  process.env.BEAVUCK_TIME_TRUSTED_ORIGINS =
62
60
  options.trustedOrigins ?? process.env.BEAVUCK_TIME_TRUSTED_ORIGINS;
63
61
  logger_1.logger.debug('TRUSTED_ORIGINS: ' + process.env.BEAVUCK_TIME_TRUSTED_ORIGINS);
64
- process.env.BEAVUCK_TIME_RATE_LIMIT =
65
- options.rateLimit === undefined
66
- ? process.env.BEAVUCK_TIME_RATE_LIMIT
67
- : String(options.rateLimit);
68
- logger_1.logger.debug('RATE_LIMIT: ' + process.env.BEAVUCK_TIME_RATE_LIMIT);
69
- process.env.BEAVUCK_TIME_LOG_LEVEL =
70
- options.logLevel ?? process.env.BEAVUCK_TIME_LOG_LEVEL;
71
- logger_1.logger.debug('LOG_LEVEL: ' + process.env.BEAVUCK_TIME_LOG_LEVEL);
72
- process.env.BEAVUCK_TIME_MAX_LOG_FILES =
73
- options.maxLogFiles === undefined
74
- ? process.env.BEAVUCK_TIME_MAX_LOG_FILES
75
- : String(options.maxLogFiles);
76
- logger_1.logger.debug('MAX_LOG_FILES: ' + process.env.BEAVUCK_TIME_MAX_LOG_FILES);
77
- process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES =
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);
80
62
  validateEnv();
81
63
  }
82
64
  function validateEnv() {
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "info": {
34
34
  "title": "beavuck-time",
35
- "version": "2.4.2",
35
+ "version": "2.4.4",
36
36
  "description": "Get time in ISO format, in UTC timezone, from a simple, lightweight node server",
37
37
  "license": {
38
38
  "name": "Unlicense"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beavuck-time",
3
- "version": "2.4.2",
3
+ "version": "2.4.4",
4
4
  "description": "Get time in ISO format, in UTC timezone, from a simple, lightweight node server",
5
5
  "keywords": [
6
6
  "time",