1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-31 08:47:03 +00:00

Add history for v3.0.0.-beta.2. Some fixes to subdomains listening on local 127.0.0.1. Change GetURI to ParseURI

Examples and e-book updated also.
This commit is contained in:
Makis Maropoulos
2016-06-04 23:07:19 +03:00
parent 1a433e34d5
commit 26ef396959
10 changed files with 109 additions and 91 deletions

11
iris.go
View File

@@ -124,14 +124,12 @@ func (s *Iris) initTemplates() {
"url": func(routeName string, args ...interface{}) (string, error) {
r := s.RouteByName(routeName)
// check if not found
if r.GetPath() == "" {
if r.GetMethod() == "" {
return "", ErrRenderRouteNotFound.Format(routeName)
}
if result, ok := r.Parse(args...); ok {
return result, nil
}
return "", nil
return r.ParseURI(args...), nil
},
}
// these should be already a non-nil map but if .New(cfg) it's not, is mergo's bug, temporary:
@@ -259,9 +257,6 @@ func (s *Iris) PreListen(opt config.Server) *server.Server {
func (s *Iris) PostListen() {
//if not error opening the server, then:
// prepare the route actions, these actions needs real server's access because that it's after server's listen
s.router.optimizeLookups()
//set the rest (for Data, Text, JSON, JSONP, XML)
s.rest = rest.New(s.config.Render.Rest)
// set the templates