Skip to content

Web Static is the Go handler for handle static files

License

Notifications You must be signed in to change notification settings

moonrhythm/webstatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webstatic

Go Report Card GoDoc

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