https://github.com/carno-php/skel-rpcd
https://github.com/carno-php/skel-rpcd
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/carno-php/skel-rpcd
- Owner: carno-php
- Created: 2018-10-30T09:28:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-25T08:38:23.000Z (over 6 years ago)
- Last Synced: 2025-01-22T06:48:04.843Z (4 months ago)
- Language: PHP
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# How to create a RPC server
## Creating project
```bash
composer create-project carno-php/skel-rpcd my-project
```## Importing service SDK
```bash
composer require my-service/sdk
```## Implements and register
`src/Services/MyService.php`
```php
namespace App\Services;class MyService extends \Carno\RPC\Server implements \ServiceAPI
{
public function method()
{
// your code
}
}
````registers.php`
```php
return [
\App\Services\MyService::class,
];
```## Run service
```bash
./vendor/bin/rpcd server:start --listen=:8080 --debug
```## Tests service API
```bash
curl -d 'PAYLOAD' http://127.0.0.1:8080/invoke/service/method
```