Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A PSR-15 middleware adapter for react/http

License

NotificationsYou must be signed in to change notification settings

friends-of-reactphp/http-middleware-psr15-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI status

Wraps PSR-15 middleware usingasync andawait fromreact/async utilizing fibers making them usable withinreact/http as middleware.

Install

To install viaComposer, use the command below, it will automatically detect the latest version and bind it with^.

composer require for/http-middleware-psr15-adapter

Usage

The following usage example usesmiddlewares/redirect adding one redirect,and using the callback to call several methods on the redirect middleware to change it's behavior:

$server =newServer(/** Other middleware */newPSR15Middleware(        (newRedirect(['/old-url' =>'/new-url']))->permanent(false)->query(false)->method(['GET','POST'])    ),/** Other middleware */);

Grouped Usage

When using more then one PSR-15 in a row theGroupedPSR15Middleware is more performing than using multiplePSR15Middleware. Consider thefollowing example where we addmiddlewares/cache for expires headers:

$loop = Factory::create();$server =newServer([/** Other middleware */    (newGroupedPSR15Middleware($loop))->withMiddleware(         (newRedirect(['/old-url' =>'/new-url']))->permanent(false)->query(false)->method(['GET','POST'])    )->withMiddleware(newExpires()    ),/** Other middleware */]);

About

A PSR-15 middleware adapter for react/http

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp