Skip to content

Latest commit

 

History

History
23 lines (14 loc) · 550 Bytes

README.md

File metadata and controls

23 lines (14 loc) · 550 Bytes

reactphp-static

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!

Buy me a coffee <3