title: Serve static resources using Clojure's Ring
body: <p>I am learning how to create web apps using Clojure's Ring. I'm trying to serve a static <strong>.html</strong> file which contains a reference to a .css file through a <code>&lt;link&gt;</code> tag in its head part. The .css file is in the same directory as the index.html file I'm trying to serve, however, the .css file is not being loaded (I get an error with a 500 status code with a reason phrase of:</p>
  
  <blockquote>
    <p>Reponse map is nil</p>
  </blockquote>
  
  <p>This is my code below:</p>
  
  <pre><code>(defroutes approutes
    (GET "/" reqmap
      (resource-response "index.html")))
  
  
  (def server (run-jetty #'approutes {:join? false, :port 3000}))
  </code></pre>
  
  <p>What am I missing here? and how can I serve an html file that has references to other files (.css, .js, .jpeg, etc)? I've had some luck (although I can't completly explain why) using Ring's <code>wrap-resource</code> middleware in the <code>ring.middleware.resource</code> namespace although that function is to be used only when a request map matches a static resource (and as you can see, the route "/" doesn't match a resource per-se).</p>
  
  <p>Thank you.</p>