// +---------------------------------------------------------------------- use think\Route; Route::group('apis', function () { Route::any('test', 'api/Demo/test'); Route::get('index', 'api/Index/index'); Route::get('article', 'api/Article/list'); Route::get('article/:id', 'api/Article/detail'); Route::get('story', 'api/Story/list'); Route::get('story/:id', 'api/Story/detail'); Route::get('about', 'api/About/list'); Route::get('about/:id', 'api/About/detail'); Route::get('product', 'api/Product/list'); Route::get('product/:id', 'api/Product/detail'); Route::get('cases', 'api/Cases/list'); Route::get('cases/:id', 'api/Cases/detail'); Route::get('cate/:type', 'api/Index/cates'); }); return [ //别名配置,别名只能是映射到控制器且访问时必须加上请求的方法 '__alias__' => [ ], //变量规则 '__pattern__' => [ ], // 域名绑定到模块 // '__domain__' => [ // 'admin' => 'admin', // 'api' => 'api', // ], ];