We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3266079 commit 82f783fCopy full SHA for 82f783f
1 file changed
README.md
@@ -1 +1,30 @@
1
-# horse-basic-auth
+# horse-basic-auth
2
+
3
+Middleware for Basic Authentication in HORSE
4
5
+Sample Horse server validate basic authentication:
6
7
+```delphi
8
+uses
9
+ Horse, Horse.BasicAuthentication;
10
11
+var
12
+ App: THorse;
13
14
+begin
15
+ App := THorse.Create(9000);
16
17
+ App.Use(HorseBasicAuthentication(
18
+ function(const AUsername, APassword: string): Boolean
19
+ begin
20
+ Result := AUsername.Equals('user') and APassword.Equals('password');
21
+ end));
22
23
+ App.Post('ping',
24
+ procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
25
26
+ Req.Send('pong');
27
+ end);
28
29
+ App.Start;
30
+```
0 commit comments