added env as a default param to the context data map

This commit is contained in:
2018-01-04 22:58:41 +00:00
parent 1e57ce3d8d
commit 6740568afb
+1
View File
@@ -14,6 +14,7 @@ import (
func NewContext(r Route, res http.ResponseWriter, req *http.Request, env string) *DefaultContext { func NewContext(r Route, res http.ResponseWriter, req *http.Request, env string) *DefaultContext {
data := make(map[string]interface{}) data := make(map[string]interface{})
data["path"] = r.Path data["path"] = r.Path
data["env"] = env
params := req.URL.Query() params := req.URL.Query()
vars := mux.Vars(req) vars := mux.Vars(req)