Edit this topic

Content route handler

: shell

: content-route-handler

: middleware

: /modules/core/routing/services/content-route-handler.js

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

ContentRouteHandler

This handler registers itself as an Express middleware that handles a catchall route with a very low priority, for content items.

Kind: global variable

ContentRouteHandler.register(scope, context)

Registers the default content middleware.

Kind: static method of ContentRouteHandler

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

ContentRouteHandler.getUrl(id) ⇒ string

Gets the URL for a regular content item (no id prefix).

Kind: static method of ContentRouteHandler
Returns: string - The URL for the content item.

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

ContentRouteHandler.getId(url)

Gets the ID for a URL.

Kind: static method of ContentRouteHandler

Param Type Description
url string the URL to map.