How to open Swagger-ui from vert.x

烂漫一生 提交于 2019-12-04 03:18:15

Well, you started in the wrong direction a bit. Those examples demonstrate how to build VertX application out of Swagger files. What you want is to serve Swagger UI through VertX. I've put an example project for you: https://github.com/AlexeySoshin/VertxSwaggerUI

When you open http://localhost:8080/swagger/ you'll see all Swagger documentation, as usual.

If you want to do that by yourself:

  1. Copy https://github.com/swagger-api/swagger-ui/tree/master/dist contents under your resources/webroot
  2. Put swagger.json along with those files
  3. Create StaticHandler in VertX: router.route("/*").handler(StaticHandler.create());
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!