[]previous and next page

robotsRoute

An API route handler that serves robots.txt.

An API route handler that serves robots.txt. The rules may depend on the request (a staging host can disallow everything).

Import#

ts
import { robotsRoute } from "@shadow-js/dusk/server";

Signature#

ts
function robotsRoute(
  build: (event: RequestEvent) => RobotsConfig | Promise<RobotsConfig>,
  options: MetadataResponseOptions = {},
): ApiHandler

Parameters#

Name Description
build Returns the robots configuration.
options The response options.

Returns#

A handler.