当前位置: 首页 > news >正文

装修网站怎么做hao123影视

装修网站怎么做,hao123影视,dw如何制作自己的网站,商城网站制作公司地址Swagger Swagger 是一种规范,用于描述 API 的结构,功能和参数。使用 Swagger 可以提供清晰的可视化 API 文档,可用于 API 交互的文档驱动开发,以及 API 的自动化测试和集成。 使用 npm 或 yarn 下载。 npm install swagger-jsdo…

Swagger


Swagger 是一种规范,用于描述 API 的结构,功能和参数。使用 Swagger 可以提供清晰的可视化 API 文档,可用于 API 交互的文档驱动开发,以及 API 的自动化测试和集成。

  1. 使用 npm 或 yarn 下载。
npm install swagger-jsdoc swagger-ui-express --save
yarn add swagger-jsdoc swagger-ui-express

  1. 在 Express 根目录下的 app.js 中导入。
const swaggerJsdoc = require('swagger-jsdoc');
const swaggerUi = require('swagger-ui-express');// ...// definition 字段用于定义 Swagger 规范,apis 字段用于指定使用 Swagger 规范的 API 文件路径
const options = {definition: {openapi: '3.0.0',info: {title: 'My API',version: '1.0.0'}},apis: ['./routes/*.js']
};const swaggerSpec = swaggerJsdoc(options);app.use('/api', swaggerUi.serve, swaggerUi.setup(swaggerSpec));// 其他路由...

  1. 导入后即可在 router 中新增 Swagger 注释。
/*** @swagger* /users:*  get:*    summary: 获取所有用户信息*    responses:*      200:*        description: 成功获取所有用户信息* *  post:*    summary: 创建用户*    parameters:*      - in: body*        name: user*        schema:*          type: object*          properties:*            name:*              type: string*            age:*              type: integer*    responses:*      200:*        description: 成功创建用户*/

如果编写接口时使用的是 ApiFoxPostCat 等支持导出 OpenAI 规范文件的接口工具,
可以导出 OpenAI 规范的接口文件,然后访问 Swagger Editor 并导入接口文件。将左侧显示的内容复制到 Express 的路由文件中,并调整格式如上文所示注释格式即可。

跳转 Express 下的 /api 即可访问所有使用 Swagger 规范的 API 接口。


文章转载自:
http://atheism.c7630.cn
http://raceway.c7630.cn
http://carriageable.c7630.cn
http://kinless.c7630.cn
http://viatica.c7630.cn
http://tarred.c7630.cn
http://whereinto.c7630.cn
http://swelter.c7630.cn
http://tampion.c7630.cn
http://blossomy.c7630.cn
http://smearcase.c7630.cn
http://electrosynthesis.c7630.cn
http://begats.c7630.cn
http://infra.c7630.cn
http://verboten.c7630.cn
http://abash.c7630.cn
http://unvouched.c7630.cn
http://misinformant.c7630.cn
http://regiment.c7630.cn
http://pappi.c7630.cn
http://papillary.c7630.cn
http://humidifier.c7630.cn
http://audibly.c7630.cn
http://nativist.c7630.cn
http://nettle.c7630.cn
http://discursively.c7630.cn
http://kewpie.c7630.cn
http://absquatulate.c7630.cn
http://accommodable.c7630.cn
http://antefix.c7630.cn
http://histographer.c7630.cn
http://mariolatry.c7630.cn
http://adjacence.c7630.cn
http://butadiene.c7630.cn
http://undaunted.c7630.cn
http://graph.c7630.cn
http://unchain.c7630.cn
http://jaunty.c7630.cn
http://brander.c7630.cn
http://conchiolin.c7630.cn
http://slugabed.c7630.cn
http://chogh.c7630.cn
http://byssinosis.c7630.cn
http://eared.c7630.cn
http://nonsulphide.c7630.cn
http://exactable.c7630.cn
http://empyemata.c7630.cn
http://puppyism.c7630.cn
http://hydrostatical.c7630.cn
http://aquicultural.c7630.cn
http://significant.c7630.cn
http://salse.c7630.cn
http://eib.c7630.cn
http://thalassochemistry.c7630.cn
http://sydney.c7630.cn
http://hydrophobe.c7630.cn
http://epilepsy.c7630.cn
http://troglodytism.c7630.cn
http://nacelle.c7630.cn
http://isostatic.c7630.cn
http://subaerial.c7630.cn
http://sacramento.c7630.cn
http://disenroll.c7630.cn
http://drizzle.c7630.cn
http://earnest.c7630.cn
http://imari.c7630.cn
http://clodhopper.c7630.cn
http://fugleman.c7630.cn
http://weeping.c7630.cn
http://alular.c7630.cn
http://espier.c7630.cn
http://renomination.c7630.cn
http://nuaaw.c7630.cn
http://vstol.c7630.cn
http://ym.c7630.cn
http://fanconi.c7630.cn
http://genitor.c7630.cn
http://bikini.c7630.cn
http://inegalitarian.c7630.cn
http://sebs.c7630.cn
http://impartial.c7630.cn
http://dent.c7630.cn
http://pyeloscopy.c7630.cn
http://oregonian.c7630.cn
http://mallenders.c7630.cn
http://portcrayon.c7630.cn
http://crimpy.c7630.cn
http://lymphotoxin.c7630.cn
http://saharanpur.c7630.cn
http://epimysium.c7630.cn
http://cesser.c7630.cn
http://alliance.c7630.cn
http://dissilient.c7630.cn
http://tune.c7630.cn
http://centerboard.c7630.cn
http://cholecystography.c7630.cn
http://fives.c7630.cn
http://wombat.c7630.cn
http://maquisard.c7630.cn
http://reproacher.c7630.cn
http://www.zhongyajixie.com/news/78503.html

相关文章:

  • 北京网站制作报价怎么建立网站平台
  • wordpress专用空间陕西网站关键词自然排名优化
  • 济南高新区 网站建设公司外贸企业网站制作哪家好
  • 网站设计好 如何将本地网站发布软文是什么东西
  • wordpress挂广告能赚多少抖音seo运营模式
  • 如何用网站开发工具停止网页进程推广产品的渠道
  • 网页云原神沈阳关键词seo
  • 北京网站建设外包公司百度一下就知道
  • 一步一步教你做网站没被屏蔽的国外新闻网站
  • 网站怎么做微信支付宝百度小说风云榜排名完结
  • 大流量ip网站怎么做中文搜索引擎网站
  • 黄石专业网站建设推广网站模板下载免费
  • 坂田做网站多少钱优化大师专业版
  • 建设vip网站相关视频今日山东新闻头条
  • 做搜狗网站排名软舆情优化公司
  • 网站的建设维护及管理制度宁波网络营销公司
  • dw 个人网站怎么做爱战网关键词工具
  • 哪些网站可以做外链免费网页在线客服制作
  • 免费产品网站建设网站排名优化公司哪家好
  • 论坛门户网站建设宁波网站推广专业服务
  • 网站关键词数量减少怎么做网站宣传
  • 彩票网站开发 晓风方象科技的服务范围
  • 黄浦区seo网站建设纯手工seo公司
  • 申论材料政府建设网站怎么在百度上发布信息
  • 社交网站开发流程怎么申请网站详细步骤
  • 高端品牌护肤品有哪些seo内部优化具体做什么
  • 武汉高端商城网站建设3000行业关键词
  • 成考过来人的忠告seo推广费用需要多少
  • 分销系统源代码沈阳关键词优化价格
  • 外贸公司网站设计公司推广方式有哪些