Skip to content

Commit 8690940

Browse files
authored
Merge pull request #1 from viniciussanchez/master
Created samples
2 parents 309b440 + fc4defb commit 8690940

File tree

10 files changed

+917
-8
lines changed

10 files changed

+917
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@ __recovery/
6565
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
6666
*.stat
6767

68-
/modules
68+
modules/

HandleException.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<DCC_CBuilderOutput>All</DCC_CBuilderOutput>
5454
<RuntimeOnlyPackage>true</RuntimeOnlyPackage>
5555
<SanitizedProjectName>HandleException</SanitizedProjectName>
56-
<DCC_UnitSearchPath>$(DCC_UnitSearchPath);modules\.dcp;modules\.dcu;modules;modules\horse\src</DCC_UnitSearchPath>
56+
<DCC_UnitSearchPath>$(DCC_UnitSearchPath);modules\.dcp;modules\.dcu;modules;modules\horse\src;modules\jhonson\src</DCC_UnitSearchPath>
5757
</PropertyGroup>
5858
<PropertyGroup Condition="'$(Base_Android)'!=''">
5959
<DCC_CBuilderOutput>None</DCC_CBuilderOutput>

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ Middleware for handle exception in HORSE
33

44
Sample Horse Server
55
```delphi
6-
uses
7-
Horse, Horse.HandleException;
6+
uses Horse, Horse.Jhonson, Horse.HandleException, System.SysUtils;
87
98
var
109
App: THorse;
1110
1211
begin
1312
App := THorse.Create(9000);
1413
14+
App.Use(Jhonson);
1515
App.Use(HandleException);
1616
17-
App.Post('ping',
17+
App.Get('ping',
1818
procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
1919
begin
20-
raise Exception.Create('My error!');
20+
raise Exception.Create('My Error!');
2121
end);
2222
2323
App.Start;

boss-lock.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"artifacts": {},
1010
"failed": false,
1111
"changed": false
12+
},
13+
"github.com/hashload/jhonson": {
14+
"name": "jhonson",
15+
"version": "1.0.3",
16+
"hash": "334dfe6b2e7daa4cb6af5b1bf88ec76e",
17+
"artifacts": {},
18+
"failed": false,
19+
"changed": false
1220
}
1321
}
1422
}

boss.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"description": "",
44
"version": "1.0.0",
55
"homepage": "",
6-
"mainsrc": "Src/",
6+
"mainsrc": "src/",
77
"projects": [],
88
"dependencies": {
9-
"github.com/hashload/horse": "^1.6.8"
9+
"github.com/hashload/horse": "^1.6.8",
10+
"github.com/hashload/jhonson": "^1.0.3"
1011
}
1112
}

samples/boss-lock.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"hash": "6ef9161b900632671022358216c7dfe7",
3+
"updated": "2019-10-15T22:07:14.0506259-03:00",
4+
"installedModules": {
5+
"github.com/hashload/handle-exception": {
6+
"name": "handle-exception",
7+
"version": "0.1.2",
8+
"hash": "519df8be252fbda605e46bef8d604915",
9+
"artifacts": {},
10+
"failed": false,
11+
"changed": false
12+
},
13+
"github.com/hashload/horse": {
14+
"name": "horse",
15+
"version": "1.6.8",
16+
"hash": "7a0b2394ac49dbd1a62f6d1021cac5b9",
17+
"artifacts": {},
18+
"failed": false,
19+
"changed": false
20+
},
21+
"github.com/hashload/jhonson": {
22+
"name": "jhonson",
23+
"version": "1.0.3",
24+
"hash": "334dfe6b2e7daa4cb6af5b1bf88ec76e",
25+
"artifacts": {},
26+
"failed": false,
27+
"changed": false
28+
}
29+
}
30+
}

samples/boss.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "samples",
3+
"description": "",
4+
"version": "1.0.0",
5+
"homepage": "",
6+
"mainsrc": "./",
7+
"projects": [],
8+
"dependencies": {
9+
"github.com/HashLoad/handle-exception": "^0.1.2",
10+
"github.com/HashLoad/horse": "^1.6.8",
11+
"github.com/hashload/jhonson": "^1.0.3"
12+
}
13+
}

samples/samples.dpr

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
program samples;
2+
3+
{$APPTYPE CONSOLE}
4+
5+
uses
6+
Horse,
7+
Horse.Jhonson,
8+
Horse.HandleException,
9+
System.SysUtils;
10+
11+
{$R *.res}
12+
13+
var
14+
App: THorse;
15+
16+
begin
17+
App := THorse.Create(9000);
18+
19+
App.Use(Jhonson);
20+
App.Use(HandleException);
21+
22+
App.Get('ping',
23+
procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
24+
begin
25+
raise Exception.Create('My Error!');
26+
end);
27+
28+
App.Start;
29+
end.

samples/samples.dproj

Lines changed: 828 additions & 0 deletions
Large diffs are not rendered by default.

samples/samples.res

55.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)