func Handler(m *fb.FileBrowser) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		c := &fb.Context{
			FileBrowser: m,
			User:        nil,
			File:        nil,
			Params:      new(fb.Params),
		}
		c.REQ = r
		c.RESP = w
		c.Method = c.REQ.Method
		code, err := serve(c)
		if err != nil {
			txt := http.StatusText(code)
			if len(c.Params.PreviewType) == 0 {
				log.Printf("%v: %v %v\n", r.URL.Path, code, txt)
				log.Println(err)
			} else {
				log.Println(err)
				err = nil
			}
		}
		if !c.Rendered && c.Router > 0 && c.Router != cnst.R_DOWNLOAD && c.Router != cnst.R_PLAYLIST {
			w.WriteHeader(code)
		}
	})
}
Handler returns a function compatible with web.HandleFunc.
package web
import (
	"encoding/json"
	"github.com/browsefile/backend/src/cnst"
	fb "github.com/browsefile/backend/src/lib"
	"github.com/browsefile/backend/src/lib/utils"
	"html/template"
	"log"
	"net/http"
	"strings"
)