Skip to content

Commit

Permalink
Make services optional.
Browse files Browse the repository at this point in the history
Also update the doc.
  • Loading branch information
danfuzz committed Dec 12, 2023
1 parent 49e2801 commit d02da3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@ one-element array.
### `hosts`

`hosts` is a list of hostname bindings. These map possibly-wildcarded hostnames
to certificate-key pairs to use to authenticate an endpoint as those hosts. This
section is only required if at least one endpoint is to respond to
host-authenticated protocols (which is of course probably going to be most of
the time).
to certificate-key pairs to use to authenticate an endpoint as those hosts.

```js
const hosts = [
Expand All @@ -60,6 +57,10 @@ the underlying certificates, where a `*` denotes exactly one subdomain. And, to
be clear, the hostname `*` will match _any_ hostname at all, with any number of
subdomains.

This section is only required if at least one endpoint is to respond to
host-authenticated protocols (which is nearly always, at least in standalone
uses).

**Note:** If you want to keep the text of the keys and certificates out of the
main configuration file, then the thing to do is just use the standard Node `fs`
package to read the contents.
Expand All @@ -86,6 +87,8 @@ const services = [
// ... more ...
```

This section is only required if there are any services being defined at all.

### `applications`

`applications` is a list of applications to be used, with each element naming
Expand Down
5 changes: 3 additions & 2 deletions src/app-config/export/WarehouseConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ import { ServiceConfig } from '#x/ServiceConfig';
* * `{object|object[]} hosts` -- Optional host / certificate configuration.
* Required only if any endpoints are configured to listen for secure
* connections.
* * `{object|object[]} services` -- System service configuration.
* * `{object|object[]} services` -- Optional system service configuration.
* If not present, no services are configured.
*/
export class WarehouseConfig extends BaseConfig {
/** @type {ApplicationConfig[]} Application configuration objects. */
Expand Down Expand Up @@ -50,7 +51,7 @@ export class WarehouseConfig extends BaseConfig {
applications,
endpoints,
hosts = [],
services
services = []
} = config;

this.#applications = ApplicationConfig.parseArray(applications, configClassMapper);
Expand Down

0 comments on commit d02da3c

Please sign in to comment.