package main import "net/http" type staticRoute struct { file []byte mime string } func (s staticRoute) ServeHTTP(w http.ResponseWriter, req *http.Request) { w.Header().Add("Content-Type", s.mime) w.Write(s.file) }