README ¶ webstatic Web Static is the Go handler for handle static files, returns not found for directory Usage http.Handle("/-/", http.StripPrefix("/-", webstatic.Dir("assets"))) or http.Handle("/-/", http.StripPrefix("/-", &webstatic.Handler{ FileSystem: http.Dir("assets"), CacheControl: "public, max-age=3600", })) License MIT Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type Handler func Dir(dir string) *Handler func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Handler ¶ type Handler struct { FileSystem http.FileSystem CacheControl string Fallback http.Handler // contains filtered or unexported fields } Handler serve static files func Dir ¶ func Dir(dir string) *Handler Dir creates new handler with http.Dir func (*Handler) ServeHTTP ¶ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) Source Files ¶ View all Source files webstatic.go Click to show internal directories. Click to hide internal directories.