简体   繁体   中英

how to view my index.html file inside webapp which is cloned from swagger ui on a url

maven-3.0.5

I want to access the swagger sample application on a browser. I'm following the instructions of sample swagger-core using this link( https://github.com/wordnik/swagger-core/tree/master/samples/java-jaxrs ).

I have cloned the swagger ui from this link( https://github.com/wordnik/swagger-ui ) and placed under the webapp folder.

How can i view my index.html file inside a web-app folder which is cloned from swagger-ui on a url?

Whenever I try to access a url it displays:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<apiResponse>
  <message>  
     null for url: http://<host>:8002/api/api-docs
  </message>
  <type>
     unknown
  </type>
</apiResponse>

I can't access the swagger-ui. Please help me to do that.

Is the index.html file loaded by your browser? If so, it seems to me like your api endpoint is not configured correctly.

Your /api-docs url should give something back like

{"apiVersion":"1.0.0","swaggerVersion":"1.2"}

If that happens, you just have to enter this url into your index.html search field...

step 1 go to this link https://github.com/wordnik/swagger-ui/archive/master.zip step 2 extract files to any location in your pc step 3 open swagger-ui-master/dist/index.html

it will open as a file in browser , or you can put it in www directory of your apcahe server and can access using localhost/swagger-ui-master/dist/index.html (depends on your webserver configuration) ,

i just followed above steps and works like a charm ,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM