0

I have Web-API enabled application hosted under IIS. I've added Swashbuckle to it and everything seems to work well. I'm able to access Swashbuckle documentation by api.cooldomain.com/swagger/ui/index

Is it possible to host Swashbuckle documentation on another Web site? (API is running on api.cooldomain.com and I would like to have Swashbuckle documentation on docs.cooldomain.com?

Jcomp
  • 13
  • 2
  • There's no reason you couldn't just have a DNS entry that points to the hosted swagger docs location. – Clint Jul 11 '16 at 11:39
  • Yes, I can have a DNS entry that points to the same web site where API is hosted(as well as Swashbuckle documentation). In that case API could be accessible via docs.cooldomain.com/api/{controller}/{method} I would like to have web site that host documentation only. – Jcomp Jul 12 '16 at 07:54

1 Answers1

1

Swashbuckle hosts your swagger API manifest JSON document at:

[your url root]/swagger/docs/[version e.g. v1]

The swashbuckle index.html hosted at /swagger actually just downloads this JSON document and uses it to populate the page.

You can just not enable the swagger UI on your API project (but still enable swagger), and then host the index.html file from Swashbuckle anywhere (it's in their repo here: Swagger-UI.

You can just have it point to the swagger manifest on the API site for rendering.

Clint
  • 6,133
  • 2
  • 27
  • 48