Merge branch 'fix-root-route-invocation' into 'master'

Allow calling root route on app

Closes #64

See merge request !91
This commit is contained in:
Travis Reeder
2017-07-11 09:44:29 -07:00
3 changed files with 10 additions and 1 deletions

View File

@@ -94,9 +94,14 @@ func (s *Server) handleRequest(c *gin.Context, enqueue models.Enqueue) {
payload = strings.NewReader(reqPayload)
}
r, routeExists := c.Get(api.Path)
if !routeExists {
r = "/"
}
reqRoute := &models.Route{
AppName: c.MustGet(api.AppName).(string),
Path: path.Clean(c.MustGet(api.Path).(string)),
Path: path.Clean(r.(string)),
}
s.FireBeforeDispatch(ctx, reqRoute)