Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kakadu-dev/php-ijson-microservices
Package for create microservice architecture based on PHP.
https://github.com/kakadu-dev/php-ijson-microservices
architecture ijson inverted json microservice php php74
Last synced: about 2 months ago
JSON representation
Package for create microservice architecture based on PHP.
- Host: GitHub
- URL: https://github.com/kakadu-dev/php-ijson-microservices
- Owner: kakadu-dev
- License: mit
- Created: 2020-05-11T16:38:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-12-06T14:33:45.000Z (about 4 years ago)
- Last Synced: 2024-04-24T08:16:33.230Z (8 months ago)
- Topics: architecture, ijson, inverted, json, microservice, php, php74
- Language: PHP
- Size: 45.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PHP 7.4 Inverted JSON Microservices
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/kakadu-dev/php-ijson-microservices)
- ~~Gateway entrypoint~~ (in-progress)
- Microservice workerInstallation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
composer require --prefer-dist kakadu-dev/php-ijson-microservices "*"
```or add
```
"kakadu-dev/php-ijson-microservices": "@dev"
```to the require section of your `composer.json` file.
Usage
-----Example microservice:
```php
use Kakadu\Microservices\Microservice;$app = Microservice::create('my-microservice', [
'ijson' => 'http://127.0.0.1:8001',
'env' => 'dev',
], true);$app->start(function ($method, $params) {
// Run method with params
// Return resultreturn ['hello' => 'world'];
});
```Start Inverted JSON:
```
version: '3.7'services:
ijson:
image: lega911/ijson
container_name: base-ijson
ports:
- 8001:8001
```Send POST request directly to: http://localhost:8001
```bash
curl http://127.0.0.1:8001/my-microservice -d '{"id": 1, "params":{"test":1}}'
```**If you run [gateway](https://github.com/kakadu-dev/nodejs-ijson-microservices).** Run POST request to: http://localhost:3000
```json
{
"id": 1,
"method": "my-service.test-method",
"params": {
"test": 1
}
}
```That's all. Check it.