Skip to content

Instantly share code, notes, and snippets.

@DanielMorsing
Created May 20, 2012 11:32
Show Gist options
  • Save DanielMorsing/2757707 to your computer and use it in GitHub Desktop.
Save DanielMorsing/2757707 to your computer and use it in GitHub Desktop.
package main
import (
"net/http"
"path"
)
var fshandler = http.FileServer(http.Dir("assets/"))
func scrubber(w http.ResponseWriter, r *http.Request) {
if path.Ext(r.URL.Path) == ".tmpl" {
http.NotFound(w, r)
return
}
fshandler.ServeHTTP(w, r)
}
func main() {
http.HandleFunc("/", scrubber)
http.ListenAndServe("localhost:8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment