mirror of
https://github.com/labstack/echo.git
synced 2025-03-05 15:05:43 +02:00
Just some variable changes
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
33700bfcc2
commit
2f8639b7e6
14
echo.go
14
echo.go
@ -374,18 +374,16 @@ func (e *Echo) Match(methods []string, path string, handler HandlerFunc, middlew
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static serves static files from provided `root` directory for `/<prefix>*` HTTP
|
// Static serves static files from provided `root` directory for `/<path>*` URL.
|
||||||
// path.
|
func (e *Echo) Static(path, root string) {
|
||||||
func (e *Echo) Static(prefix, root string) {
|
e.StaticWithConfig(path, StaticConfig{
|
||||||
e.StaticWithConfig(prefix, StaticConfig{
|
|
||||||
Root: root,
|
Root: root,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaticWithConfig serves static files with provided config for `/<prefix>*` HTTP
|
// StaticWithConfig serves static files with provided config for `/<path>*` URL.
|
||||||
// path.
|
func (e *Echo) StaticWithConfig(path string, config StaticConfig) {
|
||||||
func (e *Echo) StaticWithConfig(prefix string, config StaticConfig) {
|
e.Get(path+"*", StaticWithConfig(config))
|
||||||
e.Get(prefix+"*", StaticWithConfig(config))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// File serve provided file for `/<path>` HTTP path.
|
// File serve provided file for `/<path>` HTTP path.
|
||||||
|
8
group.go
8
group.go
@ -82,16 +82,16 @@ func (g *Group) Group(prefix string, m ...MiddlewareFunc) *Group {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Static implements `Echo#Static()` for sub-routes within the Group.
|
// Static implements `Echo#Static()` for sub-routes within the Group.
|
||||||
func (g *Group) Static(prefix, root string) {
|
func (g *Group) Static(path, root string) {
|
||||||
g.StaticWithConfig(prefix, StaticConfig{
|
g.StaticWithConfig(path, StaticConfig{
|
||||||
Root: root,
|
Root: root,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// StaticWithConfig implements `Echo#StaticWithConfig()` for sub-routes within the
|
// StaticWithConfig implements `Echo#StaticWithConfig()` for sub-routes within the
|
||||||
// Group.
|
// Group.
|
||||||
func (g *Group) StaticWithConfig(prefix string, config StaticConfig) {
|
func (g *Group) StaticWithConfig(path string, config StaticConfig) {
|
||||||
g.Get(prefix+"*", StaticWithConfig(config))
|
g.Get(path+"*", StaticWithConfig(config))
|
||||||
}
|
}
|
||||||
|
|
||||||
// File implements `Echo#File()` for sub-routes within the Group.
|
// File implements `Echo#File()` for sub-routes within the Group.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user