server/admin/static.go

19 lines
319 B
Go
Raw Normal View History

package main
import (
"net/http"
2016-01-22 16:34:34 +00:00
"path"
)
2016-01-22 16:34:34 +00:00
type staticRouting struct{
StaticDir string
}
func StaticHandler(staticDir string) http.Handler {
return staticRouting{staticDir}
}
func (a staticRouting) ServeHTTP(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, path.Join(a.StaticDir, "index.html"))
}