https://blog.csdn.net/xialei199023/article/details/63251482php
https://blog.csdn.net/qq_16142851/article/details/78319768?locationNum=1&fps=1java
/**
* @api {get} index.php?i= 测试一 * @apiGroup test * @apiVersion 0.0.1 * @apiDescription 这是第一个测试 * @apiParam {String} token 登陆token * @apiParamExample 请求样例 * /index.php?i=8888 * @apiSuccess {int} type 类型 0:上行 1:下行 * @apiExample 请求成功数据 * { * "status": "1", * "data": { * "first": 1, * "last": 3, * }, * "msg": "操做成功" * } * @apiExample {json} 失败返回样例: * {"code":"0","msg":"修改为功"} */
/** * @api {POST} /test/:id 测试二 * @apiGroup test * @apiVersion 0.0.1 * @apiDescription 这是第二个测试 * @apiParam {String} name 名字 * @apiParam {String} [phone] 手机 * @apiSuccess (Success) {String} msg 信息 * @apiSuccess (Success) {int} code 0 表明无错误 1表明有错误 * @apiError (Error) {String} msg 信息 * @apiError (Error) {String} m 信息 * @apiParamExample 请求样例 * /index.php?i=8888 * @apiSuccessExample {json} 返回样例 * {"code":"0","msg":"修改为功"} * @apiErrorExample {json} 失败返回样例 * {"code":"0","msg":"修改为功"} */
* @apiDeprecated [提示消息] //弃用标志 若是未指定[]里面内容{包括中括号},则下次不产生该接口,若是指定,则输出提示消息 * @api {POST} /test/:id 测试二 //指定接收方式以及显示名称 * @apiGroup //分组 * @apiVersion //版本 * @apiDescription //描述 * @apiParam {String} name 名字 // 参数类型 以及参数名称 没有中括号表明必选参数 * @apiParam {String} [phone] 手机 // 参数类型 以及参数名称 [phone] 表明可选参数 * @apiSuccess (Success) {String} msg 信息 //返回成功数据名称以及类型 * @apiError (Error) {String} msg 信息 //返回失败数据名称以及类型 * @apiParamExample 请求样例 //示例 * /index.php?i=8888 //例子 * @apiSuccessExample {json} 返回样例 // 返回成功数据以及指定返回数据格式 * {"code":"0","msg":"修改为功"} //指定json格式后能够不用格式化,apidoc 输出的时候会作作处理 * @apiErrorExample {json} 失败返回样例 // 返回失败数据以及指定返回数据格式 * {"code":"0","msg":"修改为功"}
检查你的项目下 有没有 apidoc.json //没有则建立 { "name": "文档名称", "version": "0.1.0", //版本号 "description": "apiDoc basic example", // 描述 "title": "Custom apiDoc browser title", // 头部 "url" : "http://192.168.197.135/" // 项目地址 "sampleUrl" : "http://192.168.197.135/" //接口默认发送的地址 }
具体问题没有找到 下面的是个人作法
# rm -rf test/apidoc/* # apidoc -i test/ -o test/apidoc/ -- 这样子就解决了!
应该是由于 nodejs版本过高 以及 npn版本过高的缘由