server/admin/static.go
2016-01-23 13:19:28 +01:00

19 lines
320 B
Go

package main
import (
"net/http"
"path"
)
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"))
}