PHPackages                             esokullu/react-restify - 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. esokullu/react-restify

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

esokullu/react-restify
======================

Create RESTful API with ReactPHP

1.1.2(8y ago)05.2k1MITPHPPHP ^7.0

Since Mar 28Pushed 5y ago1 watchersCompare

[ Source](https://github.com/esokullu/React-Restify)[ Packagist](https://packagist.org/packages/esokullu/react-restify)[ RSS](/packages/esokullu-react-restify/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (3)Versions (11)Used By (0)

React-Restify
=============

[](#react-restify)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7229e166940416366b2e317fcc0674c193a783a33e14d6d1c84987515df089e1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4361704d6f757373652f52656163742d526573746966792f6261646765732f7175616c6974792d73636f72652e706e673f733d36643139383664626334326435666335613165323331333438393662323834373937646532396230)](https://scrutinizer-ci.com/g/CapMousse/React-Restify/)

> RESTful api made easy for [ReactPHP](http://nodephp.org/), seriously.

Instalation
-----------

[](#instalation)

Via composer

```
    $ composer require capmousse/react-restify
```

Create server
-------------

[](#create-server)

Here is an exemple of a simple HTTP server replying to all get call like `http://127.0.0.1:1337/hello/you`

```
require 'vendor/autoload.php';

$server = new CapMousse\ReactRestify\Server("MyAPP", "0.0.0.1");

// Middleware
$server->use(function ($request, $next) {
	print_r($request->getMethod());
	$next();
});

// Dependency injection
$server->add(\Foo\Bar::class)

$server->get('/hello/{name}', function ($request, $response, \Foo\Bar $bar, $name) {
    $response
    	->write("Hello {$name}")
    	->end();

    $bar->foobar();
});

$server->listen(1337);
```

To create a secure HTTPS server, you need to give all your cert files to the server :

```
$server->listen(1337, "[::1]", [
    'local_cert' => __DIR__ . 'localhost.pem'
]);
```

More examples can be found on the example directory like the **Todo** example.

Controller, Middleware and Dependency injection
-----------------------------------------------

[](#controller-middleware-and-dependency-injection)

React-Restify support Controller call, middleware *à la express* and Dependency Injection.

```
use CapMousse\ReactRestify\Http\Request;
use CapMousse\ReactRestify\Http\Response;

class Foo {
    public function bar() {
        echo "Do something";
    }
}

class FooBar {
    public function baz (Response $response, Foo $foo) {
        $foo->bar();
        $response->end()
    }
}

$server->add(Foo::class);

$server->use(function ($request, $next) {
    echo $request->httpRequest->getPath();
});

$server->get('/', 'FooBar@baz');
```

Design goals
------------

[](#design-goals)

*React-Restify* was primary made to build RESTful api easily. It can be used like *Silex* or *Express*.

Next part will be to support Sockets, Upgrade Requests... to create a real time API server.

Licence
-------

[](#licence)

MIT, see LICENCE file

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 67.4% 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 ~247 days

Recently: every ~308 days

Total

6

Last Release

3238d ago

Major Versions

0.2.0 → 1.0.02017-02-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3b6d80630289b910b490ff8998d30fd7a83e346ee6568e91c5df5eaae64d294?d=identicon)[esokullu](/maintainers/esokullu)

---

Top Contributors

[![esokullu](https://avatars.githubusercontent.com/u/19166?v=4)](https://github.com/esokullu "esokullu (31 commits)")[![igorw](https://avatars.githubusercontent.com/u/88061?v=4)](https://github.com/igorw "igorw (10 commits)")[![CAMOBAP](https://avatars.githubusercontent.com/u/2169738?v=4)](https://github.com/CAMOBAP "CAMOBAP (3 commits)")[![guss77](https://avatars.githubusercontent.com/u/381782?v=4)](https://github.com/guss77 "guss77 (1 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

---

Tags

restreactrestify

### Embed Badge

![Health badge](/badges/esokullu-react-restify/health.svg)

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

###  Alternatives

[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M330](/packages/api-platform-core)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k67.4M258](/packages/nelmio-api-doc-bundle)[api-platform/state

API Platform state interfaces

274.9M131](/packages/api-platform-state)[mezzio/mezzio-problem-details

Problem Details for PSR-7 HTTP APIs addressing the RFC 7807 standard

271.2M29](/packages/mezzio-mezzio-problem-details)[mezzio/mezzio-hal

Hypertext Application Language implementation for PHP and PSR-7

21500.9k6](/packages/mezzio-mezzio-hal)[rx/websocket

Websockets for PHP using Rx

34182.4k2](/packages/rx-websocket)

PHPackages © 2026

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