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