updates on #71
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/hacdias/caddy-hugo/tools/templates"
|
||||
"github.com/hacdias/caddy-hugo/tools/variables"
|
||||
"github.com/mholt/caddy/middleware"
|
||||
"github.com/mholt/caddy/middleware/browse"
|
||||
"github.com/mholt/caddy/caddyhttp/browse"
|
||||
"github.com/mholt/caddy/caddyhttp/httpserver"
|
||||
)
|
||||
|
||||
// GET handles the GET method on browse page and shows the files listing Using
|
||||
@@ -26,13 +26,13 @@ func GET(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
|
||||
// Using Caddy's Browse middleware
|
||||
b := browse.Browse{
|
||||
Next: middleware.HandlerFunc(func(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
Next: httpserver.HandlerFunc(func(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
return 404, nil
|
||||
}),
|
||||
Configs: []browse.Config{
|
||||
{
|
||||
PathScope: "/",
|
||||
Root: http.Dir(conf.Path),
|
||||
Root: http.Dir(conf.Path),
|
||||
Variables: conf,
|
||||
Template: tpl,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user