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 26fd1ef commit f6db971
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This middleware is compatible with projects developed in:
- [X] Delphi
- [X] Lazarus

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

## ⚡️ Quickstart Lazarus
```delphi
{$MODE DELPHI}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Horse,
Horse.OctetStream, // It's necessary to use the unit
SysUtils,
Classes;
procedure GetStream(Req: THorseRequest; Res: THorseResponse; Next: TNextProc);
var
LStream: TFileStream;
begin
// Now you can send your stream:
LStream := TFileStream.Create(ExtractFilePath(ParamStr(0)) + 'horse.pdf', fmOpenRead);
Res.Send<TStream>(LStream);
end;
begin
// It's necessary to add the middleware in the Horse:
THorse.Use(OctetStream);
THorse.Get('/stream', GetStream);
THorse.Listen(9000);
end.
```

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

0 comments on commit f6db971

Please sign in to comment.