ss/static.go

21 lines
319 B
Go
Raw Permalink Normal View History

2024-05-19 20:48:06 +03:00
package ss
import (
"net/http"
)
func StaticDir(pth string) Handler {
return Wrap{
UseRelUrl: true,
HttpHandler: http.FileServer(http.Dir(pth)),
}
}
func StaticFile(pth string) Handler {
return Wrap{
HttpHandler: HttpHandlerFunc(func(w ResponseWriter, r *Request){
http.ServeFile(w, r, pth)
}),
}
}