PHPackages                             wyrihaximus/react-http-middleware-fast-route - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. wyrihaximus/react-http-middleware-fast-route

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wyrihaximus/react-http-middleware-fast-route
============================================

Fast Route ReactPHP HTTP Server Middleware

10[1 issues](https://github.com/WyriHaximus/reactphp-http-middleware-fast-route/issues)[1 PRs](https://github.com/WyriHaximus/reactphp-http-middleware-fast-route/pulls)PHPCI failing

Since Dec 25Pushed 3mo agoCompare

[ Source](https://github.com/WyriHaximus/reactphp-http-middleware-fast-route)[ Packagist](https://packagist.org/packages/wyrihaximus/react-http-middleware-fast-route)[ RSS](/packages/wyrihaximus-react-http-middleware-fast-route/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

ReactPHP HTTP Server Fast Route Middleware
==========================================

[](#reactphp-http-server-fast-route-middleware)

[![Build Status](https://camo.githubusercontent.com/908d4e3e398f5fa57efb0686322947a99f7a1dc2381b82f987c5219d9b62674b/68747470733a2f2f7472617669732d63692e636f6d2f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d666173742d726f7574652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/WyriHaximus/reactphp-http-middleware-fast-route)[![Latest Stable Version](https://camo.githubusercontent.com/e9395156a2d7145f9271be0e223de27cea38ae0087fbda1c0f6c5e5cfcc0c06b/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163747068702d687474702d6d6964646c65776172652d666173742d726f7574652f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/react-http-middleware-fast-route)[![Total Downloads](https://camo.githubusercontent.com/6455f38daa92acfcfa8f34dd8d4b824521293b6293c820baf6fcc42ca2a120ed/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163742d687474702d6d6964646c65776172652d666173742d726f7574652f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/react-http-middleware-fast-route/stats)[![Code Coverage](https://camo.githubusercontent.com/b3387572bed662921c9bdb0553adecbbc2bf2f67712d113c2122adf7362c86ee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f77797269686178696d75732f72656163747068702d687474702d6d6964646c65776172652d666173742d726f7574652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/wyrihaximus/reactphp-http-middleware-fast-route/?branch=master)[![License](https://camo.githubusercontent.com/c9c3e71e50d77f4d3ef3d3b54dfe143f9405c02abc09f26be8e66faf0fe49480/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f72656163747068702d687474702d6d6964646c65776172652d666173742d726f7574652f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/reactphp-http-middleware-fast-route)[![PHP 7 ready](https://camo.githubusercontent.com/bf71e86d4fe2bd6e1861831a3483d287deeaad330271627145e264570c5650fb/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d666173742d726f7574652f62616467652e737667)](https://travis-ci.com/WyriHaximus/reactphp-http-middleware-fast-route)

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/react-http-middleware-fast-route

```

Usage
=====

[](#usage)

This middleware only detects the correct route for you or returns a 404/405 when failing, you still have to call the handler yourself.

```
$middleware = new FastRouteMiddleware([
  new Route('GET', '/user/{name}/{id:[0-9]+}', function (ServerRequestInterface $request): PromiseInterface {
      return resolve(new Response(200));
  }, [
      'attribute' => 'value',
  ]),
]);
```

Attributes
==========

[](#attributes)

This middleware sets two attributes when passing on the request to the next middleware:

- `Attributes::HANDLER`: The handler specified in the Route VO.
- `Attributes::ANNOTATIONS`: Any annotations passed into the Route VO.

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2019 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

21

↓

LowBetter than 19% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 79.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (192 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (36 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (14 commits)")

---

Tags

hacktoberfest

### Embed Badge

![Health badge](/badges/wyrihaximus-react-http-middleware-fast-route/health.svg)

```
[![Health](https://phpackages.com/badges/wyrihaximus-react-http-middleware-fast-route/health.svg)](https://phpackages.com/packages/wyrihaximus-react-http-middleware-fast-route)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
