How to open local files in Swagger-UI

前端 未结 13 1715
粉色の甜心
粉色の甜心 2020-12-23 09:10

I\'m trying to open my self generated swagger specification file my.json with swagger-ui on my local computer.

So I downloaded the latest tag v2.1.8-M1

13条回答
  •  余生分开走
    2020-12-23 09:40

    Instead of opening swagger ui as a file - you put into browser file:///D:/swagger-ui/dist/index.html you can: create iis virtual directory which enables browsing and points to D:/swagger-ui

    1. open mmc, add iis services, expand Default Web Site add virtual directory, put alias: swagger-ui, physical path:(your path...) D:/swagger-ui
    2. in mmc in the middle pane double click on "directory browsing"
    3. in mmc in the right pane click "enable"
    4. after that in browser put url to open your local swagger-ui http://localhost/swagger-ui/dist/
    5. now you can use ../my.json if you copied file into dist folder or you can created separate forlder for samples, say D:/swagger-ui/samples and use ../samples/my.json or http://localhost/swagger-ui/samples/my.json

提交回复
热议问题