Edit this topic

Documentation route handler

: shell

: middleware

: documentation

: /modules/core/documentation/services/documentation-route-handler.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/documentation/services/documentation-route-handler.js

DocumentationRouteHandler

This handler registers itself as an Express middleware that handles a catchall route under /docs/* with a normal priority, for documentation content items.

DocumentationRouteHandler.register(scope, context)

Registers the documentation middleware.

Param Type Description
scope object The scope.
context object The context.
context.expressApp object The Express application object.

DocumentationRouteHandler.getUrl(id) ⇒ string

Gets the URL for a documentation topic (id prefix 'docs:').

Returns: string - The URL for the topic.

Param Type Description
id string The topic content item's id.

DocumentationRouteHandler.getId(url)

Gets the ID for a url, or null if not resolved.

Param Type Description
url string the URL to resolve.