ordinaryjellyfish/react-static

A simple middleware for serving static files with ReactPHP

0.2.0 2020-03-13 03:22 UTC

This package is auto-updated.

Last update: 2024-11-13 13:55:25 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!

Buy me a coffee <3