zhangdehua 1 سال پیش
والد
کامیت
f2da6950c7
3فایلهای تغییر یافته به همراه18 افزوده شده و 2 حذف شده
  1. 1 1
      config/app.php
  2. 1 1
      config/route.php
  3. 16 0
      route/api.php

+ 1 - 1
config/app.php

@@ -9,7 +9,7 @@ return [
     // 应用的命名空间
     'app_namespace'    => '',
     // 是否启用路由
-    'with_route'       => false,
+    'with_route'       => true,
     // 是否启用事件
     'with_event'       => true,
     // 默认应用

+ 1 - 1
config/route.php

@@ -20,7 +20,7 @@ return [
     // pathinfo分隔符
     'pathinfo_depr'         => '/',
     // URL伪静态后缀
-    'url_html_suffix'       => '',
+    'url_html_suffix'       => 'html',
     // URL普通方式参数 用于自动生成
     'url_common_param'      => true,
     // 是否开启路由延迟解析

+ 16 - 0
route/api.php

@@ -0,0 +1,16 @@
+<?php
+
+// +----------------------------------------------------------------------
+// | ThinkPHP [ WE CAN DO IT JUST THINK ]
+// +----------------------------------------------------------------------
+// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
+// +----------------------------------------------------------------------
+// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
+// +----------------------------------------------------------------------
+// | Author: liu21st <liu21st@gmail.com>
+// +----------------------------------------------------------------------
+use think\facade\Route;
+Route::group('/api',function (){
+    Route::get('/index/hello', '\app\api\controller\Index@index');
+
+});