diff --git a/api/agent/call.go b/api/agent/call.go index 3b811c919..2df2f95ba 100644 --- a/api/agent/call.go +++ b/api/agent/call.go @@ -79,7 +79,8 @@ func FromRequest(appName, path string, req *http.Request) CallOpt { baseVars["FN_FORMAT"] = route.Format baseVars["FN_APP_NAME"] = appName - baseVars["FN_ROUTE"] = route.Path + baseVars["FN_PATH"] = route.Path + // TODO: might be a good idea to pass in: envVars["FN_BASE_PATH"] = fmt.Sprintf("/r/%s", appName) || "/" if using DNS entries per app baseVars["FN_MEMORY"] = fmt.Sprintf("%d", route.Memory) baseVars["FN_TYPE"] = route.Type diff --git a/api/models/error.go b/api/models/error.go index c6a27a4dc..eb9b40350 100644 --- a/api/models/error.go +++ b/api/models/error.go @@ -154,7 +154,7 @@ var ( } ) -// any error that implements this interface will return an API response +// APIError any error that implements this interface will return an API response // with the provided status code and error message body type APIError interface { Code() int @@ -170,7 +170,7 @@ func (e err) Code() int { return e.code } func NewAPIError(code int, e error) APIError { return err{code, e} } -// uniform error output +// Error uniform error output type Error struct { Error *ErrorBody `json:"error,omitempty"` } diff --git a/examples/app/README.md b/examples/app/README.md new file mode 100644 index 000000000..4e823b5a6 --- /dev/null +++ b/examples/app/README.md @@ -0,0 +1,7 @@ +# App Example + +This shows you how to organize functions into a full application and deploy them easily with one command. + +## TODOs + +* [ ] Use a header/footer endpoint and pull them into the functions? diff --git a/examples/tutorial/hello/app.yaml b/examples/app/app.yaml similarity index 100% rename from examples/tutorial/hello/app.yaml rename to examples/app/app.yaml diff --git a/examples/app/footer/func.rb b/examples/app/footer/func.rb new file mode 100644 index 000000000..1e9f72581 --- /dev/null +++ b/examples/app/footer/func.rb @@ -0,0 +1,7 @@ +puts %{ +
+