mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
adds FN_FORMAT, APP_NAME and ROUTE to hot containers
This commit is contained in:
@@ -373,7 +373,6 @@ func (hc *htfn) serve(ctx context.Context) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
cfg.Env["FN_FORMAT"] = cfg.Format
|
|
||||||
cfg.Timeout = 0 // add a timeout to simulate ab.end. failure.
|
cfg.Timeout = 0 // add a timeout to simulate ab.end. failure.
|
||||||
cfg.Stdin = hc.containerIn
|
cfg.Stdin = hc.containerIn
|
||||||
cfg.Stdout = hc.containerOut
|
cfg.Stdout = hc.containerOut
|
||||||
|
|||||||
@@ -152,12 +152,15 @@ func (s *Server) serve(ctx context.Context, c *gin.Context, appName string, rout
|
|||||||
}
|
}
|
||||||
return "https"
|
return "https"
|
||||||
}(), c.Request.Host, c.Request.URL.String()),
|
}(), c.Request.Host, c.Request.URL.String()),
|
||||||
"CALL_ID": reqID,
|
"CALL_ID": reqID,
|
||||||
"FORMAT": route.Format,
|
"FN_FORMAT": route.Format,
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO we could add... format, app_name, route from above (but nothing from the specific request)
|
// baseVars are the vars on the route & app, not on this specific request [for hot functions]
|
||||||
baseVars := make(map[string]string, len(app.Config)+len(route.Config))
|
baseVars := make(map[string]string, len(app.Config)+len(route.Config)+3)
|
||||||
|
baseVars["FN_FORMAT"] = route.Format
|
||||||
|
baseVars["APP_NAME"] = appName
|
||||||
|
baseVars["ROUTE"] = route.Path
|
||||||
|
|
||||||
// app config
|
// app config
|
||||||
for k, v := range app.Config {
|
for k, v := range app.Config {
|
||||||
|
|||||||
Reference in New Issue
Block a user