Anti.Framework on top of react http server

dev-master 2020-06-28 22:03 UTC

This package is auto-updated.

Last update: 2020-07-14 23:30:36 UTC


Scrutinizer Code Quality Code Coverage Build Status Code Intelligence Status

Adapter that allows running Antidot Framework Applications on a React PHP server


Using composer package manager

composer require antidot-fw/antidot-react-http:dev-master

We have to add the config provider to the framework configuration to load the necessary dependencies, we make sure to load it after the provider of the framework itself.

// config/config.php

$aggregator = new ConfigAggregator([
    // ... other config providers
    \Antidot\Container\Config\ConfigProvider::class, // Framework default config provider
    \Antidot\React\Container\Config\ConfigProvider::class, // React Application config provider
    new PhpFileProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.php'),
    new YamlConfigProvider(realpath(__DIR__).'/services/{{,*.}prod,{,*.}local,{,*.}dev}.yaml'),
    new ArrayProvider($cacheConfig),
], $cacheConfig['config_cache_path']);

return $aggregator->getMergedConfig();

Running server:

We just need to run a console command and we'll have the server up and running on port 8080.

bin/console react-server:http

Server config:

    uri: "localhost:8080"