PHPackages                             mvc4us/react-static - 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. mvc4us/react-static

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

mvc4us/react-static
===================

A simple middleware for serving static files with ReactPHP

v0.2.0(3y ago)097MITPHPPHP &gt;=8.1

Since Feb 17Pushed 3y agoCompare

[ Source](https://github.com/mvc4us/reactphp-static)[ Packagist](https://packagist.org/packages/mvc4us/react-static)[ RSS](/packages/mvc4us-react-static/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

reactphp-static
===============

[](#reactphp-static)

A simple middleware for serving static files with ReactPHP

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

[](#installation)

```
composer require mvc4us/react-static
```

Usage
-----

[](#usage)

Use it in your ReactPHP like a normal middleware, passing in an array of base url(s) pointing to associated webroot(s). All the files under any webroot (including subdirectories) will be served.

```
new Mvc4us\ReactStatic\StaticServer([
    "/" => "/wwwroot/domain/public",
    "/docs" => "/documents/from/other/directory"
]);
```

Optionally to exclude some files you can define an array of shell patterns as a second parameter:

```
new Mvc4us\ReactStatic\StaticServer(
    ["/" => "/webroot"],
    ["*.php", ".htaccess", "*private*"]
);
```

The middleware will serve any static files if they exist or return 404 response if it is excluded. If a file does not exist for the requested path, it continues processing next middleware, letting you run the rest of your application.

Enjoy!

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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.

###  Release Activity

Cadence

Every ~240 days

Total

2

Last Release

1311d ago

PHP version history (2 changes)v0.1.0PHP &gt;=8.0

v0.2.0PHP &gt;=8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/00a7cf23cfa3b66e4652cd201e7e1d869d8ff5ee577676863ab0c6db5a8b20f3?d=identicon)[erdemuncuoglu](/maintainers/erdemuncuoglu)

---

Top Contributors

[![erdemuncuoglu](https://avatars.githubusercontent.com/u/4586452?v=4)](https://github.com/erdemuncuoglu "erdemuncuoglu (2 commits)")[![OrdinaryJellyfish](https://avatars.githubusercontent.com/u/33029517?v=4)](https://github.com/OrdinaryJellyfish "OrdinaryJellyfish (1 commits)")

### Embed Badge

![Health badge](/badges/mvc4us-react-static/health.svg)

```
[![Health](https://phpackages.com/badges/mvc4us-react-static/health.svg)](https://phpackages.com/packages/mvc4us-react-static)
```

###  Alternatives

[discord-php/http

Handles HTTP requests to Discord servers

25318.7k8](/packages/discord-php-http)[clue/soap-react

Simple, async SOAP webservice client library, built on top of ReactPHP

64118.0k2](/packages/clue-soap-react)[rx/websocket

Websockets for PHP using Rx

34181.5k2](/packages/rx-websocket)[php-http/react-adapter

React HTTP Adapter

19260.9k3](/packages/php-http-react-adapter)[voryx/websocketmiddleware

WebSocket Middleware for React

2669.2k3](/packages/voryx-websocketmiddleware)[drift/http-kernel

Http Kernel component for Drift, based on Symfony Http Kernel component

3624.1k17](/packages/drift-http-kernel)

PHPackages © 2026

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