diff --git a/website/docs/registry/registry-configuration.md b/website/docs/registry/registry-configuration.md index 9541fba..6a4f292 100644 --- a/website/docs/registry/registry-configuration.md +++ b/website/docs/registry/registry-configuration.md @@ -125,10 +125,15 @@ For unsuscribing to all [events](#registry-events). ### Development and Discovery Options -| Parameter | Type | Mandatory | Default | Description | -| ------------------------- | ----------------- | --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -| discovery | boolean | no | `true` | Enables the HTML discovery page and `/components` endpoint | -| discoveryFunc | function | no | - | Function to decide whether discovery should be enabled for the current request. Function signature: `(opts: { host?: string; secure: boolean }) => boolean` | +| Parameter | Type | Mandatory | Default | Description | +| ------------------------------ | ----------------- | --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| discovery | boolean or object | no | `true` | Enables the HTML discovery page and `/components` endpoint. Pass a boolean to toggle everything at once, or an object to fine-tune individual aspects (see below) | +| discovery.robots | boolean | no | `true` | Appends a `` tag to the discovery page's HTML head. Set to `false` to append `noindex, nofollow` instead | +| discovery.api | boolean | no | `true` | Enables the discovery API endpoints (e.g. `/components`) | +| discovery.ui | boolean | no | `true` | Enables the HTML discovery page | +| discovery.validate | boolean | no | `false` | Enables validation for the discovery API | +| discovery.experimental | boolean | no | `true` | Shows experimental components in the discovery API. Has no effect when `discovery.api` is `false` | +| discoveryFunc | function | no | - | Function to decide whether discovery should be enabled for the current request. Function signature: `(opts: { host?: string; secure: boolean }) => boolean` | | local | boolean | no | - | Enables **local development mode** (what `oc dev` sets). Not a storage selector — see [Local development mode](#local-development-mode) | | path | string | no | - | Absolute path where local components are stored (required when `local` is `true`) | | hotReloading | boolean | no | `!!local` | Enables hot-reloading of component code. Defaults to `true` when `local` is `true` | @@ -253,6 +258,35 @@ var registry = new oc.Registry(configuration); registry.start(); ``` +### Discovery Configuration + +`discovery` accepts either a boolean (to enable/disable everything at once) or an object to configure the HTML discovery page and API independently: + +```js +var oc = require("oc"); + +var configuration = { + baseUrl: "https://components.mycompany.com/", + port: 3000, + discovery: { + ui: true, // Enable the HTML discovery page + api: true, // Enable the discovery API endpoints + validate: true, // Validate requests against the discovery API + experimental: false, // Hide experimental components from the discovery API + robots: false, // Add a noindex, nofollow meta tag to the discovery page + }, + s3: { + bucket: "my-components-bucket", + region: "us-east-1", + componentsDir: "components", + path: "//s3.amazonaws.com/my-components-bucket/", + }, +}; + +var registry = new oc.Registry(configuration); +registry.start(); +``` + ### Local Development Configuration Prefer `oc dev` over hand-rolling this. The CLI starts a registry with `local: true` and the right defaults for day-to-day component work.