-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathTestProject.lpr
More file actions
69 lines (58 loc) · 1.26 KB
/
TestProject.lpr
File metadata and controls
69 lines (58 loc) · 1.26 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
program TestProject;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}
cthreads,
{$ENDIF}
Classes, SysUtils, CustApp, httpserver, routeping
{ you can add units after this };
type
{ TBrookframeworkTest }
TBrookframeworkTest = class(TCustomApplication)
protected
procedure DoRun; override;
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; override;
end;
{ TBrookframeworkTest }
procedure TBrookframeworkTest.DoRun;
var
server: THTTPServer;
begin
server := THTTPServer.Create(nil);
try
server.SetupServer;
server.Open;
if not server.Active then
begin
WriteLn('Unable to start server at https://localhost:', server.Port);
Terminate(-1);
end
else
begin
WriteLn('Server running at https://localhost:', server.Port);
ReadLn;
end;
finally
server.Free;
end;
Terminate;
end;
constructor TBrookframeworkTest.Create(TheOwner: TComponent);
begin
inherited Create(TheOwner);
StopOnException:=True;
end;
destructor TBrookframeworkTest.Destroy;
begin
inherited Destroy;
end;
var
Application: TBrookframeworkTest;
begin
Application:=TBrookframeworkTest.Create(nil);
Application.Title:='Brookframework Test Server';
Application.Run;
Application.Free;
end.