Edit this topic

Content route handler

: shell

: middleware

: content-route-handler

: /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.

ContentRouteHandler.register(scope, context)

Registers the default content middleware.

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).

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.

Param Type Description
url string the URL to map.