mirror of
https://github.com/labstack/echo.git
synced 2025-04-27 12:32:09 +02:00
Updated godoc
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
parent
130c548826
commit
01ac846770
5
echo.go
5
echo.go
@ -375,14 +375,15 @@ func (e *Echo) Match(methods []string, path string, handler HandlerFunc, middlew
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Static serves static files from provided root directory with URL path prefix.
|
// Static registers a new route with path prefix to serve static files from the
|
||||||
|
// provided root directory.
|
||||||
func (e *Echo) Static(prefix, root string) {
|
func (e *Echo) Static(prefix, root string) {
|
||||||
e.Get(prefix+"*", func(c Context) error {
|
e.Get(prefix+"*", func(c Context) error {
|
||||||
return c.File(path.Join(root, c.P(0)))
|
return c.File(path.Join(root, c.P(0)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// File serves provided file for URL path.
|
// File registers a new route with path to serve a static file.
|
||||||
func (e *Echo) File(path, file string) {
|
func (e *Echo) File(path, file string) {
|
||||||
e.Get(path, func(c Context) error {
|
e.Get(path, func(c Context) error {
|
||||||
return c.File(file)
|
return c.File(file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user