Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
viniciussanchez authored Dec 28, 2021
1 parent 1ab5d3b commit 3a0168e
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This middleware is compatible with projects developed in:
- [X] Delphi
- [X] Lazarus

## ⚡️ Quickstart
## ⚡️ Quickstart Delphi
```delphi
uses
Horse,
Expand All @@ -50,5 +50,36 @@ begin
end;
```

## ⚡️ Quickstart Lazarus
```delphi
{$MODE DELPHI}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Horse,
Horse.Jhonson, // It's necessary to use the unit
Horse.HandleException, // It's necessary to use the unit
SysUtils;
procedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);
begin
// Manage your exceptions:
raise EHorseException.Create('My Error');
end;
begin
// It's necessary to add the middlewares in the Horse:
THorse
.Use(Jhonson) // It has to be before the exceptions middleware
.Use(HandleException);
THorse.Get('/ping', GetPing);
THorse.Listen(9000);
end.
```

## ⚠️ License
`handle-exception` is free and open-source middleware licensed under the [MIT License](https://github.com/HashLoad/handle-exception/blob/master/LICENSE).

0 comments on commit 3a0168e

Please sign in to comment.