-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a812030
commit aa6c992
Showing
11 changed files
with
107 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<CONFIG> | ||
<ProjectOptions> | ||
<Version Value="11"/> | ||
<PathDelim Value="\"/> | ||
<General> | ||
<Flags> | ||
<MainUnitHasCreateFormStatements Value="False"/> | ||
<MainUnitHasTitleStatement Value="False"/> | ||
<MainUnitHasScaledStatement Value="False"/> | ||
</Flags> | ||
<SessionStorage Value="InProjectDir"/> | ||
<MainUnit Value="0"/> | ||
<Title Value="Console"/> | ||
<UseAppBundle Value="False"/> | ||
<ResourceType Value="res"/> | ||
</General> | ||
<BuildModes Count="1"> | ||
<Item1 Name="Default" Default="True"/> | ||
</BuildModes> | ||
<PublishOptions> | ||
<Version Value="2"/> | ||
<UseFileFilters Value="True"/> | ||
</PublishOptions> | ||
<RunParams> | ||
<FormatVersion Value="2"/> | ||
<Modes Count="0"/> | ||
</RunParams> | ||
<Units Count="1"> | ||
<Unit0> | ||
<Filename Value="Console.lpr"/> | ||
<IsPartOfProject Value="True"/> | ||
</Unit0> | ||
</Units> | ||
</ProjectOptions> | ||
<CompilerOptions> | ||
<Version Value="11"/> | ||
<PathDelim Value="\"/> | ||
<Target> | ||
<Filename Value="Console"/> | ||
</Target> | ||
<SearchPaths> | ||
<IncludeFiles Value="$(ProjOutDir)"/> | ||
<OtherUnitFiles Value="..\..\src;..\..\modules\horse\src;..\..\modules\jhonson\src"/> | ||
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> | ||
</SearchPaths> | ||
<Other> | ||
<CustomOptions Value="-dUseCThreads"/> | ||
</Other> | ||
</CompilerOptions> | ||
<Debugging> | ||
<Exceptions Count="3"> | ||
<Item1> | ||
<Name Value="EAbort"/> | ||
</Item1> | ||
<Item2> | ||
<Name Value="ECodetoolError"/> | ||
</Item2> | ||
<Item3> | ||
<Name Value="EFOpenError"/> | ||
</Item3> | ||
</Exceptions> | ||
</Debugging> | ||
</CONFIG> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
program Console; | ||
|
||
{$MODE DELPHI}{$H+} | ||
|
||
uses | ||
{$IFDEF UNIX}{$IFDEF UseCThreads} | ||
cthreads, | ||
{$ENDIF}{$ENDIF} | ||
Horse, | ||
Horse.Jhonson, | ||
Horse.HandleException, | ||
SysUtils; | ||
|
||
procedure GetPing(Req: THorseRequest; Res: THorseResponse; Next: TNextProc); | ||
begin | ||
raise EHorseException.Create('My Error'); | ||
end; | ||
|
||
procedure OnListen(Horse: THorse); | ||
begin | ||
Writeln(Format('Server is runing on %s:%d', [Horse.Host, Horse.Port])); | ||
end; | ||
|
||
begin | ||
THorse | ||
.Use(Jhonson) | ||
.Use(HandleException); | ||
|
||
THorse.Get('/ping', GetPing); | ||
|
||
THorse.Listen(9000, OnListen); | ||
end. |
Binary file not shown.