PHPackages                             barretstorck/server-request-router - 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. barretstorck/server-request-router

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

barretstorck/server-request-router
==================================

A PSR-15 compliant HTTP middleware that routes requests to other middlewares

v1.0(1y ago)02MITPHP

Since Jan 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/barretstorck/server-request-router)[ Packagist](https://packagist.org/packages/barretstorck/server-request-router)[ RSS](/packages/barretstorck-server-request-router/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Server Request Router
=====================

[](#server-request-router)

A PSR-15 compliant ServerRequestInterface router that allows for conditional routing to different middlewares based on the properties of the ServerRequest. This allows for only using middlewares when they are needed, and when the middlewares are provided as [lazy objects](https://www.php.net/manual/en/language.oop5.lazy-objects.php)then they can skip instantiation entirely if not needed, saving time and server resources.

Installation
------------

[](#installation)

```
composer require barretstorck/server-request-router
```

Examples
========

[](#examples)

Hello world
-----------

[](#hello-world)

```
