How to set up a standalone swagger-ui server / application?

I would like to create a standalone swagger-ui application to view different APIs from different servers in one central place. In the second step, I would like to configure swagger-ui to display multiple APIs at the same time. I do not want to add swagger-ui to all servers that provide api-dag for swagger.

For this, I would like to use spring boot and thought it should be a simple task. However, it's hard for me to get it to work.

Here is what I did:

  • Spring boot application generated using https://start.spring.io
  • included spring-boot-starter-web
  • add dependency io.springfox:springfox-swagger-ui:2.3.1

When opening http: // localhost: 8080 / swagger-ui.html I see a 404 error and the user interface seems to be broken:

swagger-ui 404

+4
source share
1 answer

Is there a reason to use Spring-boot instead of a simple web server for this?

See here with Nginx , including some basic authentication (a pretty old link, but still fine) or in the ReadMe swagger-ui github reposiory directly for the convenience of working with Connect / gulp -serve inside Docker (the setting can also be played directly without Docker , If you want to).

, , ... , - .

0

Source: https://habr.com/ru/post/1626025/


All Articles