meatoff/upchain

There is no license information available for the latest version (dev-master) of this package.

dev-master 2017-06-10 12:20 UTC

This package is not auto-updated.

Last update: 2025-04-26 23:10:06 UTC


README

Upchain-php is modern protocol for communication with microservices through cluster.

Install

$ composer require meatoff/upchain

Create Service

require_once '../vendor/autoload.php';

use meatoff\upchain\HttpAdapter;
use meatoff\upchain\Service;

$service = new Service(HttpAdapter::class);

$service->input("auth", function ($input, $payload) {
    if($input['email'] == 'email@email.com' && $input['password'] == 'password') {
        $payload['auth_token'] = bin2hex(random_bytes(16));
        $payload['user_id'] = 534;
    }
    return $payload;
});

$service->serve();

Create Cluster

For cluster creation you can use upchain-js.