Scroll to navigation

GOLF(2gg) Development GOLF(2gg)

NAME

before-handler - (service-processing)

PURPOSE

Execute your code before a request is handled.

SYNTAX

before-handler
...
end-before-handler

DESCRIPTION

Every Golf request goes through a request dispatcher (see request()), which is auto-generated. In order to specify your code to execute before a request is handled, create source file "before-handler.golf" and implement code that starts with "before-handler" and ends with "end-before-handler", which will be automatically picked up and compiled with your application.

If no request executes (for example if your application does not handle a given request), before-handler handler does not execute either.

EXAMPLES

Here is a simple implementation of before-handler handler that just outputs "Getting Started!!":

before-handler

@Getting Started!! end-before-handler

SEE ALSO


Service processing

after-handler before-handler begin-handler call-handler See all documentation

$VERSION $DATE