Ubuntu Manpages

before-handler

(service-processing)

Execute your code before a request is handled.

before-handler
...
end-before-handler

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.

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

before-handler
    @Getting Started!! 
end-before-handler


Service processing

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