mirror of
https://github.com/labstack/echo.git
synced 2025-03-03 14:52:47 +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
|
||||
// path.
|
||||
func (e *Echo) Static(prefix, root string) {
|
||||
e.StaticWithConfig(prefix, StaticConfig{
|
||||
// Static serves static files from provided `root` directory for `/<path>*` URL.
|
||||
func (e *Echo) Static(path, root string) {
|
||||
e.StaticWithConfig(path, StaticConfig{
|
||||
Root: root,
|
||||
})
|
||||
}
|
||||
|
||||
// StaticWithConfig serves static files with provided config for `/<prefix>*` HTTP
|
||||
// path.
|
||||
func (e *Echo) StaticWithConfig(prefix string, config StaticConfig) {
|
||||
e.Get(prefix+"*", StaticWithConfig(config))
|
||||
// StaticWithConfig serves static files with provided config for `/<path>*` URL.
|
||||
func (e *Echo) StaticWithConfig(path string, config StaticConfig) {
|
||||
e.Get(path+"*", StaticWithConfig(config))
|
||||
}
|
||||
|
||||
// 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.
|
||||
func (g *Group) Static(prefix, root string) {
|
||||
g.StaticWithConfig(prefix, StaticConfig{
|
||||
func (g *Group) Static(path, root string) {
|
||||
g.StaticWithConfig(path, StaticConfig{
|
||||
Root: root,
|
||||
})
|
||||
}
|
||||
|
||||
// StaticWithConfig implements `Echo#StaticWithConfig()` for sub-routes within the
|
||||
// Group.
|
||||
func (g *Group) StaticWithConfig(prefix string, config StaticConfig) {
|
||||
g.Get(prefix+"*", StaticWithConfig(config))
|
||||
func (g *Group) StaticWithConfig(path string, config StaticConfig) {
|
||||
g.Get(path+"*", StaticWithConfig(config))
|
||||
}
|
||||
|
||||
// File implements `Echo#File()` for sub-routes within the Group.
|
||||
|
Loading…
x
Reference in New Issue
Block a user