PHP code example of ledc / swoole-routes
1. Go to this page and download the library: Download ledc/swoole-routes library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ledc / swoole-routes example snippets
use Ledc\SwooleRoutes\Autoloader;
// 添加路由文件:子进程重启会重新加载路由文件(即路由规则热更新)
Autoloader::addFile(__DIR__ . '/route.php');
// 添加路由目录:子进程重启会重新扫描目录内的新增路由文件,并加载(即路由文件热更新)
Autoloader::addDirectory(__DIR__ . '/route');