经过apidoc生成api文档

参考:html

http://apidocjs.com/node

http://blog.csdn.net/xumin198908/article/details/41964159npm


1)环境准备(前提是已经具有nodejs环境)api

npm install apidoc -g


2)添加注释app

/**
 * @api {get} / 请求APP信息
 * @apiName  请求APP信息
 * @apiGroup User
 *
 * 
 *
 * @apiSuccess {String} return_code Firstname of the User.
 * @apiSuccess {String} return_msg  Lastname of the User.
 * @apiSuccess {String} err_code  Lastname of the User.
 * @apiSuccess {String} err_msg  Lastname of the User.
 * @apiSuccess {Object[]} appInfo  Lastname of the User.
 */


3)生效生成.net

apidoc -i myapp/ -o apidoc -e "node_modules"

   注意 code

   i,表明输入,即要生成文档的项目htm

   o,表明输出,文档的目的地blog

   e,表明排除,排除某些文件或文件夹文档


3)查看

   /apidoc/index.html

相关文章
相关标签/搜索