ordinaryjellyfish / react-static
A simple middleware for serving static files with ReactPHP
0.2.0
2020-03-13 03:22 UTC
Requires
- react/http: ^0.8.5
This package is auto-updated.
Last update: 2024-12-13 14:14:35 UTC
README
A simple middleware for serving static files with ReactPHP
Installation
composer require ordinaryjellyfish/react-static
Usage
Use it in your ReactPHP like a normal middleware, passing in your webroot:
new OrdinaryJellyfish\ReactStatic\StaticServer(__DIR__);
The middleware will serve any static files if they exist. If a file does not exist for the requested path, the middleware will exit, letting you run the rest of your application.
Enjoy!