title: Serving static content with a root URL with the Gorilla toolkit
body: <p>I am attempting to use the Gorilla toolkit's <a href="http://www.gorillatoolkit.org/pkg/mux" rel="noreferrer"><code>mux</code> package</a> to route URLs in a Go web server.  Using <a href="https://stackoverflow.com/questions/14081066/gae-golang-gorilla-mux-404-page-not-found/14082905#14082905">this question</a> as a guide I have the following Go code: </p>
  
  <pre><code>func main() {
      r := mux.NewRouter()
      r.Handle("/", http.FileServer(http.Dir("./static/")))
      r.HandleFunc("/search/{searchTerm}", Search)
      r.HandleFunc("/load/{dataId}", Load)
      http.Handle("/", r)
      http.ListenAndServe(":8100", nil)
  }
  </code></pre>
  
  <p>The directory structure is:</p>
  
  <pre><code>...
  main.go
  static\
    | index.html
    | js\
       | &lt;js files&gt;
    | css\
       | &lt;css files&gt;
  </code></pre>
  
  <p>The Javascript and CSS files are referenced in <code>index.html</code> like this:</p>
  
  <pre><code>...
  &lt;link rel="stylesheet" href="css/redmond/jquery-ui.min.css"/&gt;
  &lt;script src="js/jquery.min.js"&gt;&lt;/script&gt;
  ...
  </code></pre>
  
  <p>When I access <code>http://localhost:8100</code> in my web browser the <code>index.html</code> content is delivered successfully, however, all the <code>js</code> and <code>css</code> URLs return 404s.</p>
  
  <p>How can I get the program to serve files out of <code>static</code> sub-directories?</p>