all: drop CONFIG_ prefix for configuration (#297)

Fixes #251
This commit is contained in:
C Cirello
2016-11-15 19:19:21 +01:00
committed by Seif Lotfy سيف لطفي
parent 6e58321928
commit 02d3b18497
13 changed files with 40 additions and 42 deletions

View File

@@ -128,12 +128,10 @@ func handleRequest(c *gin.Context, enqueue models.Enqueue) {
// app config
for k, v := range app.Config {
envVars[ToEnvName("CONFIG", k)] = v
envVars[ToEnvName("", k)] = v
}
// route config
for k, v := range found.Config {
envVars[ToEnvName("CONFIG", k)] = v
envVars[ToEnvName("", k)] = v
}
// params

View File

@@ -49,21 +49,21 @@ func TestRouteRunnerAsyncExecution(t *testing.T) {
expectedCode int
expectedEnv map[string]string
}{
{"/r/myapp/myroute", ``, map[string][]string{}, http.StatusOK, map[string]string{"CONFIG_TEST": "true", "CONFIG_APP": "true"}},
{"/r/myapp/myroute", ``, map[string][]string{}, http.StatusOK, map[string]string{"TEST": "true", "APP": "true"}},
{
"/r/myapp/myroute/1",
``,
map[string][]string{"X-Function": []string{"test"}},
http.StatusOK,
map[string]string{
"CONFIG_TEST": "true",
"CONFIG_APP": "true",
"TEST": "true",
"APP": "true",
"PARAM_PARAM": "1",
"HEADER_X_FUNCTION": "test",
},
},
{"/r/myapp/myerror", ``, map[string][]string{}, http.StatusOK, map[string]string{"CONFIG_TEST": "true", "CONFIG_APP": "true"}},
{"/r/myapp/myroute", `{ "name": "test" }`, map[string][]string{}, http.StatusOK, map[string]string{"CONFIG_TEST": "true", "CONFIG_APP": "true"}},
{"/r/myapp/myerror", ``, map[string][]string{}, http.StatusOK, map[string]string{"TEST": "true", "APP": "true"}},
{"/r/myapp/myroute", `{ "name": "test" }`, map[string][]string{}, http.StatusOK, map[string]string{"TEST": "true", "APP": "true"}},
} {
body := bytes.NewBuffer([]byte(test.body))