mirror of
https://github.com/kataras/iris.git
synced 2026-01-06 11:37:06 +00:00
Add a simple and pure .Regex middleware for routers that don't support regex route path validations out-of-the-box
Former-commit-id: 84cf1fb267e54543ad6d419b2ca39658b2773b58
This commit is contained in:
@@ -43,6 +43,11 @@ func staticPath(path string) string {
|
||||
return path
|
||||
}
|
||||
|
||||
// Name is the name of the router
|
||||
//
|
||||
// See $iris_instance.Config.Other for more.
|
||||
const Name = "gorillamux"
|
||||
|
||||
// New returns a new gorilla mux router which can be plugged inside iris.
|
||||
// This is magic.
|
||||
func New() iris.Policies {
|
||||
@@ -52,6 +57,7 @@ func New() iris.Policies {
|
||||
return iris.Policies{
|
||||
EventPolicy: iris.EventPolicy{Boot: func(s *iris.Framework) {
|
||||
logger = s.Log
|
||||
s.Set(iris.OptionOther(iris.RouterNameConfigKey, Name))
|
||||
}},
|
||||
RouterReversionPolicy: iris.RouterReversionPolicy{
|
||||
// path normalization done on iris' side
|
||||
|
||||
Reference in New Issue
Block a user