beavuck-time 2.3.8 → 2.3.10
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 +4 -7
- package/build/config/logger.js +1 -1
- package/build/server.js +1 -0
- package/openapi/swagger.json +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -86,15 +86,12 @@ If you want to run this service programmatically in your Node.js project:
|
|
|
86
86
|
```js
|
|
87
87
|
import { startServer } from 'beavuck-time'
|
|
88
88
|
|
|
89
|
-
startServer(
|
|
90
|
-
port: 3000,
|
|
91
|
-
hostUrl: 'https://time-api.example.com',
|
|
92
|
-
trustedOrigins: 'https://my.app.com,https://my-other.app.com'
|
|
93
|
-
})
|
|
89
|
+
startServer()
|
|
94
90
|
```
|
|
95
91
|
|
|
96
|
-
You can rely on environment variables (BEAVUCK_TIME_HOST_URL, etc.)
|
|
97
|
-
|
|
92
|
+
You can rely on environment variables (BEAVUCK_TIME_HOST_URL, etc.) stored in a `.env` file at the root of your project.
|
|
93
|
+
It is a known limitation -- work is in progress to allow passing those options directly as parameters to `startServer()`.
|
|
94
|
+
Refer to the Docker Compose example below to see an exhaustive list of available environment variables and what they do.
|
|
98
95
|
|
|
99
96
|
#### CLI
|
|
100
97
|
|
package/build/config/logger.js
CHANGED
|
@@ -11,7 +11,7 @@ const dotenvx_1 = __importDefault(require("@dotenvx/dotenvx"));
|
|
|
11
11
|
dotenvx_1.default.config({
|
|
12
12
|
ignore: ['MISSING_ENV_FILE'],
|
|
13
13
|
});
|
|
14
|
-
const LOGS_DIR = 'logs';
|
|
14
|
+
const LOGS_DIR = 'beavuck-time-logs';
|
|
15
15
|
const LOG_LEVEL = process.env.BEAVUCK_TIME_LOG_LEVEL ?? 'info';
|
|
16
16
|
const MAX_LOG_FILES = process.env.BEAVUCK_TIME_MAX_LOG_FILES ?? 64;
|
|
17
17
|
const MAX_SIZE_LOG_FILES = process.env.BEAVUCK_TIME_MAX_SIZE_LOG_FILES ?? '1m';
|
package/build/server.js
CHANGED
|
@@ -23,6 +23,7 @@ function validateEnv({ hostUrl, trustedOrigins, }) {
|
|
|
23
23
|
process.exit(1);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
+
// FIXME the server options method causes an exception, npm users will have to use a .env file for now
|
|
26
27
|
function startServer(options = {}) {
|
|
27
28
|
const API_PORT = options.port ?? process.env.BEAVUCK_TIME_API_PORT ?? 3000;
|
|
28
29
|
const HOST_URL = options.hostUrl ?? process.env.BEAVUCK_TIME_HOST_URL ?? '';
|
package/openapi/swagger.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beavuck-time",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.10",
|
|
4
4
|
"description": "Get time in ISO format, in UTC timezone, from a simple, lightweight node server",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"time",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "Unlicense",
|
|
21
21
|
"author": "Alexis Drai",
|
|
22
22
|
"type": "commonjs",
|
|
23
|
-
"main": "build/
|
|
23
|
+
"main": "build/server.js",
|
|
24
24
|
"files": [
|
|
25
25
|
"build/",
|
|
26
26
|
"openapi/swagger.json",
|