File: before-handler.2gg

package info (click to toggle)
golf 601.4.41-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,824 kB
  • sloc: ansic: 20,020; sh: 1,171; makefile: 292
file content (45 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
.TH GOLF 2gg $VERSION $DATE Development Tools
.SH NAME
before-handler \-  (service-processing)
.SH PURPOSE
Execute your code before a request is handled.

.SH SYNTAX

.RS 4
.EX

before-handler
\[char46]..
end-before-handler

.EE
.RE

.SH DESCRIPTION
Every Golf request goes through a request dispatcher (see \fBrequest\fP()), 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 \fBrequest\fP), before-handler handler does not execute either. 

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

.RS 4
.EX

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

.EE
.RE

.SH SEE ALSO
 Service processing

\fBafter-handler\fP  
\fBbefore-handler\fP  
\fBbegin-handler\fP  
\fBcall-handler\fP   
See all 
\fBdocumentation\fP