mirror of
https://github.com/kataras/iris.git
synced 2026-01-01 09:17:02 +00:00
create the new FileServer and HandleDir, deprecate the rest APIBuilder/Party static methods and more
relative: https://github.com/kataras/iris/issues/1283 and removing pongo2 from vendor: https://github.com/kataras/iris/issues/1284 Former-commit-id: 3ec57b349f99faca2b8e36d9f7252db0b6ea080d
This commit is contained in:
@@ -25,6 +25,15 @@ func WildcardParam(name string) string {
|
||||
return prefix(name, WildcardParamStart)
|
||||
}
|
||||
|
||||
// WildcardFileParam wraps a named parameter "file" with the trailing "path" macro parameter type.
|
||||
// At build state this "file" parameter is prefixed with the request handler's `WildcardParamStart`.
|
||||
// Created mostly for routes that serve static files to be visibly collected by
|
||||
// the `Application#GetRouteReadOnly` via the `Route.Tmpl().Src` instead of
|
||||
// the underline request handler's representation (`Route.Path()`).
|
||||
func WildcardFileParam() string {
|
||||
return "{file:path}"
|
||||
}
|
||||
|
||||
func convertMacroTmplToNodePath(tmpl macro.Template) string {
|
||||
routePath := tmpl.Src
|
||||
if len(routePath) > 1 && routePath[len(routePath)-1] == '/' {
|
||||
|
||||
Reference in New Issue
Block a user