Skip to content

Commit

Permalink
Merge c645c98 into c6a1731
Browse files Browse the repository at this point in the history
  • Loading branch information
bosunski committed Apr 21, 2020
2 parents c6a1731 + c645c98 commit c68d5a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -2,6 +2,12 @@

This package provides a routing `RequestHandler` for [Amp's HTTP server](https://github.com/amphp/http-server) based on the request URI and method based on [FastRoute](https://github.com/nikic/FastRoute).

## Installation
The router can be installed using composer like this:
```bash
composer require amphp/http-server-router
```

## Usage

**`Router`** implements `RequestHandler`. Any attached `RequestHandler` and `Middleware` instances will receive any `ServerObserver` events.
Expand Down Expand Up @@ -31,4 +37,4 @@ The `Router` will decode the URI path before matching.
This will also decode any forward slashes (`/`), which might result in unexpected matching for URIs with encoded slashes.
FastRoute placeholders match path segments by default, which are separated by slashes.
That means a route like `/token/{token}` won't match if the token contains an encoded slash.
You can work around this limitation by using a custom regular expression for the placeholder like `/token/{token:.+}`.
You can work around this limitation by using a custom regular expression for the placeholder like `/token/{token:.+}`.

0 comments on commit c68d5a0

Please sign in to comment.