antidot-fw / antidot-react-http
此包已被放弃,不再维护。未建议替代包。
基于react http服务器的Anti.Framework
dev-main
2021-01-30 12:27 UTC
Requires
- php: ^7.4.3
- antidot-fw/fast-router-adapter: ^0.1.0
- antidot-fw/framework: ^0.1.1
- react/event-loop: ^1.1
- react/http: ^0.8.5
- react/socket: ^1.3
- recoil/react: ^1.0
- recoil/recoil: ^1.0
Requires (Dev)
- phpro/grumphp: 0.16.2
- phpstan/phpstan: ^0.11.5
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.4
- symfony/var-dumper: ^4.2
This package is auto-updated.
Last update: 2021-03-01 00:33:10 UTC
README
[已弃用] 此包将不再维护。如果您想使用Antidot框架进行react开发,请查看 Reactive Starter包
适配器,允许在 Antidot框架应用 在 React PHP服务器 上运行
安装
使用 composer包管理器
composer require antidot-fw/antidot-react-http:dev-master
我们必须将配置提供者添加到框架配置中,以加载必要的依赖项,我们确保在框架本身提供者之后加载它。
<?php // config/config.php declare(strict_types=1); $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();
运行服务器
我们只需要运行一个控制台命令,服务器就会在端口 8080
上启动并运行。
bin/console react-server:http
服务器配置
parameters: react_http_server: uri: "localhost:8080"