Skip to content

Commit

Permalink
Merge pull request #1 from viniciussanchez/master
Browse files Browse the repository at this point in the history
Created samples
  • Loading branch information
hunsche authored Oct 29, 2019
2 parents 309b440 + fc4defb commit 8690940
Show file tree
Hide file tree
Showing 10 changed files with 917 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ __recovery/
# Castalia statistics file (since XE7 Castalia is distributed with Delphi)
*.stat

/modules
modules/
2 changes: 1 addition & 1 deletion HandleException.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<DCC_CBuilderOutput>All</DCC_CBuilderOutput>
<RuntimeOnlyPackage>true</RuntimeOnlyPackage>
<SanitizedProjectName>HandleException</SanitizedProjectName>
<DCC_UnitSearchPath>$(DCC_UnitSearchPath);modules\.dcp;modules\.dcu;modules;modules\horse\src</DCC_UnitSearchPath>
<DCC_UnitSearchPath>$(DCC_UnitSearchPath);modules\.dcp;modules\.dcu;modules;modules\horse\src;modules\jhonson\src</DCC_UnitSearchPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Android)'!=''">
<DCC_CBuilderOutput>None</DCC_CBuilderOutput>
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ Middleware for handle exception in HORSE

Sample Horse Server
```delphi
uses
Horse, Horse.HandleException;
uses Horse, Horse.Jhonson, Horse.HandleException, System.SysUtils;
var
App: THorse;
begin
App := THorse.Create(9000);
App.Use(Jhonson);
App.Use(HandleException);
App.Post('ping',
App.Get('ping',
procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
begin
raise Exception.Create('My error!');
raise Exception.Create('My Error!');
end);
App.Start;
Expand Down
8 changes: 8 additions & 0 deletions boss-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"artifacts": {},
"failed": false,
"changed": false
},
"github.com/hashload/jhonson": {
"name": "jhonson",
"version": "1.0.3",
"hash": "334dfe6b2e7daa4cb6af5b1bf88ec76e",
"artifacts": {},
"failed": false,
"changed": false
}
}
}
5 changes: 3 additions & 2 deletions boss.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
"description": "",
"version": "1.0.0",
"homepage": "",
"mainsrc": "Src/",
"mainsrc": "src/",
"projects": [],
"dependencies": {
"github.com/hashload/horse": "^1.6.8"
"github.com/hashload/horse": "^1.6.8",
"github.com/hashload/jhonson": "^1.0.3"
}
}
30 changes: 30 additions & 0 deletions samples/boss-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"hash": "6ef9161b900632671022358216c7dfe7",
"updated": "2019-10-15T22:07:14.0506259-03:00",
"installedModules": {
"github.com/hashload/handle-exception": {
"name": "handle-exception",
"version": "0.1.2",
"hash": "519df8be252fbda605e46bef8d604915",
"artifacts": {},
"failed": false,
"changed": false
},
"github.com/hashload/horse": {
"name": "horse",
"version": "1.6.8",
"hash": "7a0b2394ac49dbd1a62f6d1021cac5b9",
"artifacts": {},
"failed": false,
"changed": false
},
"github.com/hashload/jhonson": {
"name": "jhonson",
"version": "1.0.3",
"hash": "334dfe6b2e7daa4cb6af5b1bf88ec76e",
"artifacts": {},
"failed": false,
"changed": false
}
}
}
13 changes: 13 additions & 0 deletions samples/boss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "samples",
"description": "",
"version": "1.0.0",
"homepage": "",
"mainsrc": "./",
"projects": [],
"dependencies": {
"github.com/HashLoad/handle-exception": "^0.1.2",
"github.com/HashLoad/horse": "^1.6.8",
"github.com/hashload/jhonson": "^1.0.3"
}
}
29 changes: 29 additions & 0 deletions samples/samples.dpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
program samples;

{$APPTYPE CONSOLE}

uses
Horse,
Horse.Jhonson,
Horse.HandleException,
System.SysUtils;

{$R *.res}

var
App: THorse;

begin
App := THorse.Create(9000);

App.Use(Jhonson);
App.Use(HandleException);

App.Get('ping',
procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
begin
raise Exception.Create('My Error!');
end);

App.Start;
end.
828 changes: 828 additions & 0 deletions samples/samples.dproj

Large diffs are not rendered by default.

Binary file added samples/samples.res
Binary file not shown.

0 comments on commit 8690940

Please sign in to comment.