chore(functions/http/request): Update sample to use declarative signature
@@ -22,6 +22,8 @@ import (
"fmt"
"net/http"
"time"
+
+ "github.com/GoogleCloudPlatform/functions-framework-go/functions"
)
var urlString = "https://example.com"
@@ -32,6 +34,10 @@ var client = &http.Client{
Timeout: 10 * time.Second,
}
+func init() {
+ functions.HTTP("MakeRequest", MakeRequest)
+}
+
// MakeRequest is an example of making an HTTP request. MakeRequest uses a
// single http.Client for all requests to take advantage of connection
// pooling and caching. See https://godoc.org/net/http#Client.
