mirror of
https://github.com/openfaas/faas.git
synced 2025-06-18 12:06:37 +00:00
Enable routing via /functions/ endpoint
This commit is contained in:
18
sample-functions/WebhookStash/handler.go
Normal file
18
sample-functions/WebhookStash/handler.go
Normal file
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
input, _ := ioutil.ReadAll(os.Stdin)
|
||||
fmt.Println("Stashing request")
|
||||
now := time.Now()
|
||||
stamp := strconv.FormatInt(now.UnixNano(), 10)
|
||||
|
||||
ioutil.WriteFile(stamp+".txt", input, 0644)
|
||||
}
|
Reference in New Issue
Block a user