carno-php/skel-rpcd

1.0.1 2018-11-28 07:21 UTC

This package is auto-updated.

Last update: 2024-10-25 21:34:36 UTC


README

Creating project

composer create-project carno-php/skel-rpcd my-project

Importing service SDK

composer require my-service/sdk

Implements and register

src/Services/MyService.php

namespace App\Services;

class MyService extends \Carno\RPC\Server implements \ServiceAPI
{
    public function method()
    {
        // your code
    }
}

registers.php

return [
    \App\Services\MyService::class,
];

Run service

./vendor/bin/rpcd server:start --listen=:8080 --debug

Tests service API

curl -d 'PAYLOAD' http://127.0.0.1:8080/invoke/service/method