navi-hey 0.5.1 → 0.5.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/README.md +1 -1
- package/lib/services/Client.js +4 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ When the web server is enabled, the following screens are available:
|
|
|
122
122
|
| Dashboard | `/#/` | Real-time job queue stats (counts per status). |
|
|
123
123
|
| Jobs list | `/#/jobs` | Table of all jobs across every status, with links to individual job pages. |
|
|
124
124
|
| Job detail | `/#/job/:id` | Full details for a specific job (ID, status, attempt count). |
|
|
125
|
-
| `clients.<name>.base_url` | Base URL for the named HTTP client. |
|
|
125
|
+
| `clients.<name>.base_url` | Base URL for the named HTTP client. Supports environment variable references (`$VAR` or `${VAR}`), resolved at configuration load time. |
|
|
126
126
|
| `clients.<name>.headers` | Optional HTTP headers sent with every request of this client. Header values support environment variable references (`$VAR` or `${VAR}`), resolved at configuration load time. |
|
|
127
127
|
| `resources.<name>` | A named group of URL requests to warm. |
|
|
128
128
|
| `url` | URL path (appended to the client's `base_url`). Supports `{:placeholder}` tokens. |
|
package/lib/services/Client.js
CHANGED
|
@@ -30,7 +30,8 @@ class Client {
|
|
|
30
30
|
*
|
|
31
31
|
* @param {string} name The name identifying the client.
|
|
32
32
|
* @param {object} config Client configuration object.
|
|
33
|
-
* @param {string} config.base_url Base URL for the client.
|
|
33
|
+
* @param {string} config.base_url Base URL for the client. Values matching
|
|
34
|
+
* `$VAR` or `${VAR}` are resolved from `process.env` at parse time.
|
|
34
35
|
* @param {number} [config.timeout] Optional request timeout in milliseconds.
|
|
35
36
|
* @param {object} [config.headers] Optional HTTP headers. Values matching
|
|
36
37
|
* `$VAR` or `${VAR}` are resolved from `process.env` at parse time.
|
|
@@ -38,7 +39,8 @@ class Client {
|
|
|
38
39
|
*/
|
|
39
40
|
static fromObject(name, config) {
|
|
40
41
|
const headers = EnvResolver.resolveObject(config.headers || {});
|
|
41
|
-
|
|
42
|
+
const baseUrl = EnvResolver.resolveValue(config.base_url);
|
|
43
|
+
return new Client({ name, baseUrl, timeout: config.timeout, headers });
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/**
|