Word

route

An address of the builder's own that is answered with the builder's own response. It is a helper word with a record of its own, and is always code.

Example

TypeScript
export const feed = route('feed', {
  method: ['GET', 'HEAD'],
  path: '/feed.xml',
  access: anyone('the feed is public'),
  run: () => new Response('<feed />'),
})

Options

OptionMeans
option.route.methodThe methods the route answers.
option.route.pathThe address of the route.
option.route.accessWho may call the route.
option.route.runThe function that answers a request.
option.route.systemGives the db of the route full access, with the reason.
option.route.originsThe other sites that may send the route a request that changes something.
option.route.limitsThe limits of the route.
option.route.wasThe old name of the route, where it was renamed.

Returns

A record that carries its options. Nothing calls it.

See also

topic.words