Giter Site home page Giter Site logo

php-ijson-microservices's Introduction

PHP 7.4 Inverted JSON Microservices

GitHub release (latest SemVer)

  • Gateway entrypoint (in-progress)
  • Microservice worker

Installation

The preferred way to install this extension is through composer.

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:

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 result

    return ['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

curl http://127.0.0.1:8001/my-microservice -d '{"id": 1, "params":{"test":1}}'

If you run gateway. Run POST request to: http://localhost:3000

{
  "id": 1,
  "method": "my-service.test-method",
  "params": {
    "test": 1
  }
}

That's all. Check it.

php-ijson-microservices's People

Contributors

antonmoisa avatar matthewpattell avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.