安装稳定版 composer create-project topthink/think thinkphp6
进入命令行thinkphp6文件下 执行php think run
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php$1 last;
}
第二步:执行指令安装多应用模式功能;
composer require topthink/think-multi-app
第三步:创建应用目录;
php think build api
第四步:版本控制
复制根目录下route文件放到api应用上,修改app.php代码
app/api/controller/v1
<?php
use think\facade\Route;
//Route::rule(':version/:controller', 'api/:version.:controller/index');
Route::rule(':version/:controller/:action',