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

阿里云虚拟主机怎么做网站附近电商培训班

阿里云虚拟主机怎么做网站,附近电商培训班,网站设计包括什么,个人网站注册概述Swagger 是一个规范和完整的框架#xff0c;用于生成、描述、调用和可视化 RESTful 风格的 Web 服务。在Ocelot网关中#xff0c;我们提供给前端的直接是Swagger#xff0c;如果Swagger分布在各个API中#xff0c;前端查看Swagger的时候非常不便#xff0c;Ocelot与Sw… 概述Swagger 是一个规范和完整的框架用于生成、描述、调用和可视化 RESTful 风格的 Web 服务。在Ocelot网关中我们提供给前端的直接是Swagger如果Swagger分布在各个API中前端查看Swagger的时候非常不便Ocelot与Swagger的集成,方便在网关项目中统一查看各个服务的api文档。所以下面我们尝试把各个项目集合起来。主要代码实现1、客户端项目安装Swashbuckle.AspNetCore2、ConfigureServices配置 services.AddSwaggerGen(c {c.SwaggerDoc(v1, new OpenApiInfo { Title  客户端1 API, Version  v1, Description  # 客户端1 service api... });// Set the comments path for the Swagger JSON and UI.var xmlFile  ${Assembly.GetExecutingAssembly().GetName().Name}.xml;var xmlPath  Path.Combine(AppContext.BaseDirectory, xmlFile);c.IncludeXmlComments(xmlPath); 3、Configure配置  app.UseSwagger();app.UseSwaggerUI(c {c.SwaggerEndpoint(/swagger/v1/swagger.json, 客户端1 API V1);}); 4、项目运行起来http://localhost:5000/swagger/index.html5、接下去是网关项目安装如下6、ConfigureServices配置    services.AddSwaggerGen(c {c.SwaggerDoc(v1,new OpenApiInfo { Title  网关test API, Version  v1, Description  # 网关test api... });});services.AddOcelot(Configuration).AddConsul(); 7、Configure配置  app.UseSwagger();app.UseSwaggerUI(c {c.SwaggerEndpoint(/swagger/v1/swagger.json, 客户端1 API V1);// c.SwaggerEndpoint(/product/swagger/v1/swagger.json, Product API V1);});8、ocelot.json添加路由{DownstreamPathTemplate: /swagger/v1/swagger.json,DownstreamScheme: http,UpstreamPathTemplate: /swagger/v1/swagger.json,UpstreamHttpMethod: [ Get ],ServiceName: ProductService,LoadBalancerOptions: {Type: RoundRobin}}, 9、最后项目运行起来 http://localhost:5003/swagger/index.html总结1、在运行过程的时候会报错如下内部异常 1: Exception: Unable to start Ocelot, errors are: Unable to start Ocelot, errors are: Unable to start Ocelot because either a ReRoute or GlobalConfiguration are using ServiceDiscoveryOptions but no ServiceDiscoveryFinderDelegate has been registered in dependency injection container. Are you missing a package like Ocelot.Provider.Consul and services.AddConsul() or Ocelot.Provider.Eureka and services.AddEureka()?,Unable to start Ocelot, errors are: Unable to start Ocelot because either a ReRoute or GlobalConfiguration are using ServiceDiscoveryOptions but no ServiceDiscoveryFinderDelegate has been registered in dependency injection container. Are you missing a package like Ocelot.Provider.Consul and services.AddConsul() or Ocelot.Provider.Eureka and services.AddEureka()? 问题原因: 容器中缺少相应的服务 解决办法:install-package Ocelot.Provider.ConsulConfigureServices服务注册中修改为 : services.AddOcelot(Configuration).AddConsul();2、开源地址https://gitee.com/conanOpenSource_admin/Example
http://wiki.neutronadmin.com/news/222454/

相关文章:

  • 高端网站建设的小知识郑州网络推广团队
  • 网站自适应手机端专业网站建设费用包括
  • 小天才电话手表网站wordpress自定义分类法
  • 河南做网站送记账广告创意
  • 广州公司网站制作企业门户样式
  • 公司网站的作用意义维护建设管理那个网站做二手买卖的
  • 绛县网站建设网站title标签内容怎么设置
  • 做短视频的网站先进网站建设流程
  • 资源网站都有哪些山河集团建设有限公司网站
  • php网站目录系统江西百度推广公司
  • 电热设备网站建设网站推广手段有哪些
  • 5年网站续费多少钱太康做网站公司
  • 网站聊天工具代码建站代理
  • 怎么做一个网站怎么样网站死链接提交
  • 平面设计网站首页链接买卖
  • 无锡网站建设 app站长工具查询网站信息
  • 煤炭网站建设规划书开发公司欠缴空置房物业费的案例
  • 摄影网站论文o2o网站建设基本流程
  • 设计 网站访问次数站长平台网站
  • 贺州网站推广网络维护员主要什么工作
  • 怎样做网络推广优选豪升网络好重庆白云seo整站优化
  • 卢龙建设银行官网网站上云网站做等保
  • 南宁哪里有做网站的公司wordpress主题怎么导入
  • 怎样在微信做产品网站网站建设欧美风格
  • 企业网站重要性网络推广是以企业产品或服务
  • 龙岗专业做网站公司精品网课平台
  • 网站建设冖金手指花总十四桐庐城乡建设局网站
  • 云南昆明网站建设价格网站建设 风险防控
  • 舟山市建设局网站建设网站服务器怎么选
  • 模拟建设官方网站移动互联网软件开发