reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
Jen W 2021-02-18T12:35:25.105500Z

hiya, is there a way to overwrite the index.html that reitit-swagger-ui uses, or do I need to use ring-swagger-ui to do that? I’ve added an index.html to a swagger-ui dir in resources but it’s not picked up automatically so wondering what I’ve missed hooking up. (I’m new to reitit and pretty new to clojure too). I want to have more control over the styling and header/footer of the docs site for a reitit API Thanks!

Jen W 2021-02-18T13:27:17.106Z

hmmm interesting. I did already have a /resources dir and I’m usings deps and integrant. I’ve restarted the whole project just in case but it doesn’t seem to be picking the index file. Do you have an example of what to pass to create-swagger-ui-handler to serve the index file from resources? Currently my project is wired up via integrant ig/refs passing opts of

{:path "/my-api"
                                             :url "/my-api/swagger.json"}
though to (swagger-ui/create-swagger-ui-handler opts) Reading through the docs of create-swagger-ui-handler and the linked config explanation I just don’t quite understand it well enough to know how to adjust it to have control of the index template

Jen W 2021-02-18T13:49:55.106200Z

I’ve changed the dirname in my resources folder, and included that in my opts map as root and that seems to have done it. I’ve grabbed the whole dist directory from https://github.com/swagger-api/swagger-ui/tree/master/dist for the time being