The OpenD Programming Language

dispatcher

A URL dispatcher.

if(cgi.dispatcher!(
	"/api/".serveApi!MyApiClass,
	"/objects/lol".serveRestObject!MyRestObject,
	"/file.js".serveStaticFile,
	"/admin/".dispatchTo!adminHandler
)) return;
More...
template dispatcher(definitions...)
version(with_breaking_cgi_features)
bool
dispatcher
(
Presenter
)
(,
Presenter presenterArg = null
)

Detailed Description

You define a series of url prefixes followed by handlers.

You may want to do different pre- and post- processing there, for example, an authorization check and different page layout. You can use different presenters and different function chains. See dispatchSubsection for details.

dispatchTo will send the request to another function for handling.

Meta