Serve index.html at / by default in Compojure

前端 未结 8 1921
无人及你
无人及你 2020-12-28 14:19

I have a static file called index.html that I\'d like to serve when someone requests /. Usually web servers do this by default, but Compojure doesn

8条回答
  •  独厮守ぢ
    2020-12-28 14:47

    when other code doesnt work, try this code.

    (GET "/about/" [] (ring.util.response/content-type
                         (ring.util.response/resource-response "about/index.html" {:root "public"}) "text/html"))
    

提交回复
热议问题