func (r Route) StaticPath() string {
	src := r.tmpl.Src
	bidx := strings.IndexByte(src, '{')
	if bidx == -1 || len(src) <= bidx {
		return src  
	}
	if bidx == 0 {  
		return "/"
	}
	return src[:bidx]
}
StaticPath returns the static part of the original, registered route path.
if /user/{id} it will return /user
if /user/{id}/friend/{friendid:int} it will return /user too
if /assets/{filepath:path} it will return /assets.
package router
import (
	"fmt"
	"strings"
	"github.com/kataras/iris/context"
	"github.com/kataras/iris/core/router/macro"
)
type Route struct {
	Name      string           
	Method    string           
	Subdomain string           
	tmpl      *macro.Template  
	Path      string           
	beginHandlers context.Handlers
	Handlers        context.Handlers
	MainHandlerName string
	doneHandlers context.Handlers
	FormattedPath string
}
func NewRoute(method, subdomain, unparsedPath, mainHandlerName string,
	handlers context.Handlers, macros *macro.Map) (*Route, error) {
	tmpl, err := macro.Parse(unparsedPath, macros)
	if err != nil {
		return nil, err
	}
	path, handlers, err := compileRoutePathAndHandlers(handlers, tmpl)
	if err != nil {
		return nil, err
	}
	path = cleanPath(path)  
	defaultName := method + subdomain + tmpl.Src
	formattedPath := formatPath(path)
	route := &Route{
		Name:            defaultName,
		Method:          method,
		Subdomain:       subdomain,
		tmpl:            tmpl,
		Path:            path,
		Handlers:        handlers,
		MainHandlerName: mainHandlerName,
		FormattedPath:   formattedPath,
	}
	return route, nil
}
func (r *Route) use(handlers context.Handlers) {
	if len(handlers) == 0 {
		return
	}
	r.beginHandlers = append(r.beginHandlers, handlers...)
}
func (r *Route) done(handlers context.Handlers) {
	if len(handlers) == 0 {
		return
	}
	r.doneHandlers = append(r.doneHandlers, handlers...)
}
func (r *Route) BuildHandlers() {
	if len(r.beginHandlers) > 0 {
		r.Handlers = append(r.beginHandlers, r.Handlers...)
		r.beginHandlers = r.beginHandlers[0:0]
	}
	if len(r.doneHandlers) > 0 {
		r.Handlers = append(r.Handlers, r.doneHandlers...)
		r.doneHandlers = r.doneHandlers[0:0]
	}  
}
func (r Route) String() string {
	return fmt.Sprintf("%s %s%s",
		r.Method, r.Subdomain, r.Tmpl().Src)
}
func (r Route) Tmpl() macro.Template {
	return *r.tmpl
}
func (r Route) IsOnline() bool {
	return r.Method != MethodNone
}
func formatPath(path string) string {
	if strings.Contains(path, ParamStart) || strings.Contains(path, WildcardParamStart) {
		var (
			startRune         = ParamStart[0]
			wildcardStartRune = WildcardParamStart[0]
		)
		var formattedParts []string
		parts := strings.Split(path, "/")
		for _, part := range parts {
			if len(part) == 0 {
				continue
			}
			if part[0] == startRune || part[0] == wildcardStartRune {
				part = "%v"
			}
			formattedParts = append(formattedParts, part)
		}
		return "/" + strings.Join(formattedParts, "/")
	}
	return path
}