Edit this topic

Api documentation route handler

: shell

: middleware

: api-documentation

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

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

ApiDocumentationRouteHandler

This handler registers itself as an Express middleware that handles a catchall route under /docs/api/* with a normal priority, for API documentation extracted from the source code of modules.

ApiDocumentationRouteHandler.register(scope, context)

Registers the API documentation middleware.

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

ApiDocumentationRouteHandler.getUrl(id) ⇒ string

Gets the URL for an API documentation topic (id prefix 'apidocs:').

Returns: string - The URL for the topic.

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

ApiDocumentationRouteHandler.getId(url)

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

Param Type Description
url string the URL to resolve.