func Abs(path string) string {
	absPath, err := filepath.Abs(path)
	if err != nil {
		return path
	}
	return absPath
}
Abs calls filepath.Abs but ignores the error and
returns the original value if any error occurred.
package router
import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"mime/multipart"
	"net/http"
	"net/textproto"
	"net/url"
	"os"
	"path"
	"path/filepath"
	"sort"
	"strconv"
	"strings"
	"sync"
	"time"
	"github.com/kataras/iris/context"
)
func StaticEmbeddedHandler(vdir string, assetFn func(name string) ([]byte, error), namesFn func() []string, assetsGziped bool) context.Handler {
	if len(vdir) > 0 {
		if vdir[0] == '.' {
			vdir = vdir[1:]
		}
		if vdir[0] == '/' || vdir[0] == os.PathSeparator {  
			vdir = vdir[1:]
		}
		if trailingSlashIdx := len(vdir) - 1; vdir[trailingSlashIdx] == '/' {
			vdir = vdir[0:trailingSlashIdx]
		}
	}
	allNames := namesFn()
	var names []string
	for _, path := range allNames {
		if !strings.HasPrefix(path, vdir) {
			continue
		}
		names = append(names, path)
	}
	h := func(ctx context.Context) {
		reqPath := strings.TrimPrefix(ctx.Request().URL.Path, "/"+vdir)
		for _, path := range names {
			if path == "/index.html" && reqPath == "/" {
				reqPath = "/index.html"
			}
			if path != vdir+reqPath {
				continue
			}
			cType := TypeByFilename(path)
			buf, err := assetFn(path)  
			if assetsGziped {
				context.AddGzipHeaders(ctx.ResponseWriter())
			}
			if err != nil {
				continue
			}
			ctx.ContentType(cType)
			if _, err := ctx.Write(buf); err != nil {
				ctx.StatusCode(http.StatusInternalServerError)
				ctx.StopExecution()
			}
			return
		}
		ctx.NotFound()
	}
	return h
}
func StaticHandler(systemPath string, showList bool, gzip bool) context.Handler {
	return NewStaticHandlerBuilder(systemPath).
		Gzip(gzip).
		Listing(showList).
		Build()
}
type StaticHandlerBuilder interface {
	Gzip(enable bool) StaticHandlerBuilder
	Listing(listDirectoriesOnOff bool) StaticHandlerBuilder
	Build() context.Handler
}
type fsHandler struct {
	directory       http.Dir
	listDirectories bool
	gzip            bool
	filesystem http.FileSystem
	once       sync.Once
	handler    context.Handler
	begin      context.Handlers
}
func toWebPath(systemPath string) string {
	webpath := strings.Replace(systemPath, "\\", "/", -1)
	webpath = strings.Replace(webpath, "//", "/", -1)
	webpath = strings.Replace(webpath, ".", "", -1)
	return webpath
}