PageRenderTime 7ms CodeModel.GetById 5ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/components/fpweb/demo/helloworld/cgi/webmodule.pas

http://github.com/graemeg/lazarus
Pascal | 43 lines | 23 code | 14 blank | 6 comment | 0 complexity | dbb95ff71ba79b956742f8a6416c4dcf MD5 | raw file
 1unit webmodule; 
 2
 3{$mode objfpc}{$H+}
 4
 5interface
 6
 7uses
 8  Classes, SysUtils, FileUtil, LResources, HTTPDefs, websession, fpHTTP, fpWeb; 
 9
10type
11
12  { TFPWebModule1 }
13
14  TFPWebModule1 = class(TFPWebModule)
15    procedure func1callRequest(Sender: TObject; ARequest: TRequest;
16      AResponse: TResponse; var Handled: Boolean);
17  private
18    { private declarations }
19  public
20    { public declarations }
21  end; 
22
23var
24  FPWebModule1: TFPWebModule1; 
25
26implementation
27
28{ TFPWebModule1 }
29
30procedure TFPWebModule1.func1callRequest(Sender: TObject; ARequest: TRequest;
31  AResponse: TResponse; var Handled: Boolean);
32begin
33  AResponse.Content := '<html><body>Hello World!</body></html>';
34
35  Handled := true;
36end;
37
38initialization
39  {$I webmodule.lrs}
40
41  RegisterHTTPModule('TFPWebModule1', TFPWebModule1); 
42end.
43