mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Ignores bad payload and just prints hello world for iron/hello.
This commit is contained in:
@@ -3,7 +3,6 @@ package main
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -12,12 +11,9 @@ type Input struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
for _, e := range os.Environ() {
|
||||
fmt.Println(e)
|
||||
}
|
||||
input := &Input{}
|
||||
if err := json.NewDecoder(os.Stdin).Decode(input); err != nil {
|
||||
log.Fatalln("Error! Bad input. ", err)
|
||||
// log.Println("Bad payload or no payload. Ignoring.", err)
|
||||
}
|
||||
if input.Name == "" {
|
||||
input.Name = "World"
|
||||
|
||||
Reference in New Issue
Block a user