Fix variable name in spawn function. Added working with json, upload examples and install&configuration documentation

This commit is contained in:
Héctor Hurtado
2019-11-20 16:33:11 +01:00
parent 25d9f1c1ef
commit a65eb102b2
5 changed files with 108 additions and 3 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ func Spawn(h *model.Handler, out io.Writer) error {
if out != nil {
cmd.Stdout = out
}
cmd.Env = append(os.Environ(), "KAPOW_URL=http://localhost:8081")
cmd.Env = append(os.Environ(), "KAPOW_DATA_URL=http://localhost:8082")
cmd.Env = append(cmd.Env, "KAPOW_HANDLER_ID="+h.ID)
err = cmd.Run()
+2 -2
View File
@@ -104,8 +104,8 @@ func TestSpawnSetsKapowURLEnvVar(t *testing.T) {
_ = Spawn(h, out)
jldata := decodeJailLover(out.Bytes())
if v, ok := jldata.Env["KAPOW_URL"]; !ok || v != "http://localhost:8081" {
t.Error("KAPOW_URL is not set properly")
if v, ok := jldata.Env["KAPOW_DATA_URL"]; !ok || v != "http://localhost:8082" {
t.Error("KAPOW_DATA_URL is not set properly")
}
}