PHPackages                             free-elephants/rest-daemon - 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. free-elephants/rest-daemon

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

free-elephants/rest-daemon
==========================

PHP http socket REST server

0.13.0(7y ago)5147[2 issues](https://github.com/FreeElephants/rest-daemon/issues)[2 PRs](https://github.com/FreeElephants/rest-daemon/pulls)BSD-2-ClausePHPCI failing

Since Nov 19Pushed 6y ago2 watchersCompare

[ Source](https://github.com/FreeElephants/rest-daemon)[ Packagist](https://packagist.org/packages/free-elephants/rest-daemon)[ RSS](/packages/free-elephants-rest-daemon/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (17)Versions (25)Used By (0)

Rest-Daemon
===========

[](#rest-daemon)

[![Build Status](https://camo.githubusercontent.com/4c79b18fd262acb215b43927d150020fee37aef86386d73c15a41a3e70886704/68747470733a2f2f7472617669732d63692e6f72672f46726565456c657068616e74732f726573742d6461656d6f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/FreeElephants/rest-daemon) [![codecov](https://camo.githubusercontent.com/7aff15d157af7a3cc4301ecbf2ace3e81bdc62fa8c79470561f3dfa56c300dba/68747470733a2f2f636f6465636f762e696f2f67682f46726565456c657068616e74732f726573742d6461656d6f6e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/FreeElephants/rest-daemon) [![Installs](https://camo.githubusercontent.com/5ca45f88e662c499de1d392f04bf7712b0aaa2a430473fe6fae01b4e855ec971/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667265652d656c657068616e74732f726573742d6461656d6f6e2e737667)](https://packagist.org/packages/free-elephants/rest-daemon) [![Releases](https://camo.githubusercontent.com/42d24016d7eb259cb279fc836bb51e2c5599fff1473004382b5aeca85574fecb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667265652d656c657068616e74732f726573742d6461656d6f6e2e737667)](https://github.com/FreeElephants/rest-daemon/releases)

**Nota Bene:**This project uses semver and [changelog](CHANGELOG.md). But it's not a stable major version. Any minor update (f.e. 0.5.\* -&gt; 0.6.\*) can break backward compatibility!

Simple PHP7 framework for fast building REST services based on middleware, PSR-7 and react.

Runned instance can be found by [link](http://rest-daemon-example.samizdam.net:8080/uptime), also see [example repo](https://github.com/FreeElephants/rest-daemon-example).

Features:
---------

[](#features)

- Middleware oriented request/response handling
- Priority PSR's support: PSR-2, -3, -4, -7, -11, -15 and other.
- Built-in Middleware to support usual REST features, like HTTP based semantics, content types, request parsing, headers.
- Choose one of two available http-daemon drivers: Ratchet [ReactPHP](https://github.com/ratchetphp/Ratchet) or [Aerys](https://github.com/amphp/aerys).
- [Swagger Integration](/docs/SWAGGER.md)

Installation
------------

[](#installation)

```
$ composer require free-elephants/rest-daemon

```

Usage
-----

[](#usage)

See example in example/rest-server.php and [documentation](/docs/INDEX.md).

### Create and Run Server:

[](#create-and-run-server)

```
# your rest-server.php script
$server = new RestServer('127.0.0.1', 8080, '0.0.0.0', ['*']); //
