APIDOC安裝使用

2021-07-28 21:02:14 字數 1054 閱讀 6926

1、安裝node 

2、修改node預設映象

npm config list檢視配置項

npm config set registry ""

3、全域性安裝apidoc

npm install apidoc -g

4、新建資料夾demo

5、建立apidoc.json檔案和test.php檔案

apidoc.json:

test.php檔案

<?php/**** 

@api

/user/

*@apidescription

獲取使用者資訊介面描述

*@apigroup

user

*@apiname

getuserinfo

*@apiparam

id 使用者id

*@apiversion

0.1.0**

*@apiexample

訪問示例:

* curl -i

**

@apisuccess

firstname firstname of the user.

*@apisuccess

lastname lastname of the user.

*/functiongetuser($id){}

6、進入demo目錄,執行命令

apidoc

如果自定義檔案字尾名:md,可用命令:apidoc -f  ".*\.md$"

7、在該目錄下會生成doc目錄,直接訪問即可

安裝和簡單使用apidoc

安裝nodejs 參考鏈結 安裝apidoc 參考鏈結 使用注意先cd到對應的路徑,再去生成文件 cd d d project think518每次修改 都需要 執行以下上的命令 apiname liststorage 方法名 apigroup alterstorage 倉儲員 倉庫 控制器 api...

APIDOC使用教程

nodejs install apidoc install npm install g apidocinstall check 使用win r快捷鍵開啟執行視窗,在文字框中輸入cmd並回車開啟windows shell。node v npm v apidoc vrun command 引數 描述 i...

ApiDoc工具使用簡介

apidoc是乙個介面文件,它的建立方式是基於你的源 的介面備註。我們只需要給介面寫好相應的文件,然後使用apidoc生成介面文件工具生成文件,便於管理和檢視 安裝配置 1.安裝apidoc npm install apidoc g 檢視是否安裝成功 node v npm v 2.給介面新增文件 官...