Download the PHP package waryway/micro-service-engine without Composer
On this page you can find all versions of the php package waryway/micro-service-engine. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download waryway/micro-service-engine
More information about waryway/micro-service-engine
Files in waryway/micro-service-engine
Package micro-service-engine
Short Description ReactPHP server for use in micro-service applications
License MIT
Informations about the package micro-service-engine
MicroServiceEngine
Base Service using ReactPHP for PHP only Microservices
Status
Description
Use this microservice engine to power you microservice! It is an extensible router / server base for ReactPHP. It provides an extremely light weight server and router combo.
The closest comparison I can think of, is express for nodejs. Only, this uses PHP!
Usage
Rough steps to getting this up an running. Example coming soon!
- Create your new PHP microservice application
- Make sure it is PSR-4!
- Add a
Router
class at the base namespace. - The namespace should be something like...
\ - Run
composer update
- 'composer require waryway/micro-service-engine'
- From the root directory of you new project, simply run:
vendor\bin\server.bat <company>\<project> 0.0.0.0:99
- or for linux:
./vendor/bin/server <company>/<project> 0.0.0.0:99
You can also run vendor\bin\server.bat -h
for further information.
Router setup
Make sure to extend the BaseRouter. More details to be added in the future!
Setting routes
The microservice engine is using the nikic/fast-route library. You can find path mapping information in the nikic/fast-route readme.
Example Routers
Example Application
https://github.com/Waryway/MicroServiceEngine/blob/master/example/Router.php
Internal Example
For this repository an example from within this this source code can be viewed by first running computer install
, then second, running :
php server Waryway\Example 0.0.0.0:89
You'll be able to visit localhost:89/index.html
and localhost:89/hi
All versions of micro-service-engine with dependencies
nikic/fast-route Version 1.2.0
waryway/php-traits-library Version 1.0.4