Skip to content

Commit aa6c992

Browse files
Lazarus samples #9
1 parent a812030 commit aa6c992

File tree

11 files changed

+107
-170
lines changed

11 files changed

+107
-170
lines changed

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Uncomment these types if you want even more clean repository. But be careful.
22
# It can make harm to an existing project source. Read explanations below.
3-
#
3+
44
# Resource files are binaries containing manifest, project icon and version info.
55
# They can not be viewed as text or compared by diff-tools. Consider replacing them with .rc files.
6-
#*.res
7-
#
6+
*.res
7+
88
# Type library file (binary). In old Delphi versions it should be stored.
99
# Since Delphi 2009 it is produced from .ridl file and can safely be ignored.
1010
#*.tlb

HandleException.res

-676 Bytes
Binary file not shown.

boss-lock.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
22
"hash": "830981b993a8554a72d15f4378c1a4cc",
3-
"updated": "2020-12-08T14:56:32.3089177-03:00",
3+
"updated": "2021-10-05T08:22:22.2575717-03:00",
44
"installedModules": {
55
"github.com/hashload/horse": {
66
"name": "horse",
7-
"version": "v2.0.6",
8-
"hash": "cca1769dfab681cfd26ae8499f9045e1",
7+
"version": "v2.0.14",
8+
"hash": "38c6bebdc7b9712d6e5856d299289a26",
99
"artifacts": {},
1010
"failed": false,
1111
"changed": false
1212
},
1313
"github.com/hashload/jhonson": {
1414
"name": "jhonson",
15-
"version": "1.0.7",
16-
"hash": "e0a2cfad431f565769ebe2815299924b",
15+
"version": "1.1.2",
16+
"hash": "85d9b3c97b5144448440d7d26bdd16de",
1717
"artifacts": {},
1818
"failed": false,
1919
"changed": false

boss.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"mainsrc": "src/",
77
"projects": [],
88
"dependencies": {
9-
"github.com/hashload/horse": "^2.0.0",
10-
"github.com/hashload/jhonson": "^1.0.7"
9+
"github.com/hashload/horse": "^2.0.14",
10+
"github.com/hashload/jhonson": "^1.1.2"
1111
}
1212
}

samples/boss-lock.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

samples/boss.json

Lines changed: 0 additions & 12 deletions
This file was deleted.
File renamed without changes.

samples/samples.dproj renamed to samples/delphi/samples.dproj

Lines changed: 1 addition & 126 deletions
Large diffs are not rendered by default.

samples/lazarus/Console.lpi

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<CONFIG>
3+
<ProjectOptions>
4+
<Version Value="11"/>
5+
<PathDelim Value="\"/>
6+
<General>
7+
<Flags>
8+
<MainUnitHasCreateFormStatements Value="False"/>
9+
<MainUnitHasTitleStatement Value="False"/>
10+
<MainUnitHasScaledStatement Value="False"/>
11+
</Flags>
12+
<SessionStorage Value="InProjectDir"/>
13+
<MainUnit Value="0"/>
14+
<Title Value="Console"/>
15+
<UseAppBundle Value="False"/>
16+
<ResourceType Value="res"/>
17+
</General>
18+
<BuildModes Count="1">
19+
<Item1 Name="Default" Default="True"/>
20+
</BuildModes>
21+
<PublishOptions>
22+
<Version Value="2"/>
23+
<UseFileFilters Value="True"/>
24+
</PublishOptions>
25+
<RunParams>
26+
<FormatVersion Value="2"/>
27+
<Modes Count="0"/>
28+
</RunParams>
29+
<Units Count="1">
30+
<Unit0>
31+
<Filename Value="Console.lpr"/>
32+
<IsPartOfProject Value="True"/>
33+
</Unit0>
34+
</Units>
35+
</ProjectOptions>
36+
<CompilerOptions>
37+
<Version Value="11"/>
38+
<PathDelim Value="\"/>
39+
<Target>
40+
<Filename Value="Console"/>
41+
</Target>
42+
<SearchPaths>
43+
<IncludeFiles Value="$(ProjOutDir)"/>
44+
<OtherUnitFiles Value="..\..\src;..\..\modules\horse\src;..\..\modules\jhonson\src"/>
45+
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
46+
</SearchPaths>
47+
<Other>
48+
<CustomOptions Value="-dUseCThreads"/>
49+
</Other>
50+
</CompilerOptions>
51+
<Debugging>
52+
<Exceptions Count="3">
53+
<Item1>
54+
<Name Value="EAbort"/>
55+
</Item1>
56+
<Item2>
57+
<Name Value="ECodetoolError"/>
58+
</Item2>
59+
<Item3>
60+
<Name Value="EFOpenError"/>
61+
</Item3>
62+
</Exceptions>
63+
</Debugging>
64+
</CONFIG>

samples/lazarus/Console.lpr

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
program Console;
2+
3+
{$MODE DELPHI}{$H+}
4+
5+
uses
6+
{$IFDEF UNIX}{$IFDEF UseCThreads}
7+
cthreads,
8+
{$ENDIF}{$ENDIF}
9+
Horse,
10+
Horse.Jhonson,
11+
Horse.HandleException,
12+
SysUtils;
13+
14+
procedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);
15+
begin
16+
raise EHorseException.Create('My Error');
17+
end;
18+
19+
procedure OnListen(Horse: THorse);
20+
begin
21+
Writeln(Format('Server is runing on %s:%d', [Horse.Host, Horse.Port]));
22+
end;
23+
24+
begin
25+
THorse
26+
.Use(Jhonson)
27+
.Use(HandleException);
28+
29+
THorse.Get('/ping', GetPing);
30+
31+
THorse.Listen(9000, OnListen);
32+
end.

0 commit comments

Comments
 (0)