Documentation ¶
Overview ¶
Create easily a http.Handler for CSS anf Js files to a Web server.
Usage:
http.Handle("/style", static.Css("style/")) http.Handle("/js", static.Js("js/"))
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type CssServer ¶
type CssServer []byte
A HTTP server for CSS.
type FileServer ¶
type FileServer struct {
// contains filtered or unexported fields
}
func File ¶
func File(path, mime string) (f *FileServer)
Css create a http.Handler that response with the file from path. The mime can be empty.
func (*FileServer) ServeHTTP ¶
func (f *FileServer) ServeHTTP(w http.ResponseWriter, _ *http.Request)
type HtmlServer ¶
type HtmlServer struct {
// contains filtered or unexported fields
}
func Html ¶
func Html(path string) (f *HtmlServer)
func (*HtmlServer) ServeHTTP ¶
func (h *HtmlServer) ServeHTTP(w http.ResponseWriter, _ *http.Request)
Click to show internal directories.
Click to hide internal directories.