Documentation
¶
Overview ¶
Package static provides a handler for static file serving with cache control and automatic fingerprinting.
Example ¶
package main
import (
"fmt"
"net/http"
"github.com/gowww/static"
)
func main() {
staticHandler := static.Handle("/static/", "static")
http.Handle("/static/", staticHandler)
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Cacheable asset: %s", staticHandler.Hash("main.js"))
})
http.ListenAndServe(":8080", nil)
}
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.