Automatic push from FunctionsAPI

This commit is contained in:
FunctionsAPI 2025-01-19 13:51:29 +00:00
parent 0d56b35bfd
commit 71255b96d3
3 changed files with 23 additions and 2 deletions

View File

@ -1,2 +1 @@
# samples # go hello-world

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module example.com/hello
go 1.17
require github.com/OpenFunction/functions-framework-go v0.5.0

17
hello.go Normal file
View File

@ -0,0 +1,17 @@
package hello
import (
"fmt"
"net/http"
"github.com/OpenFunction/functions-framework-go/functions"
)
func init() {
functions.HTTP("Main", Main,
functions.WithFunctionPath("/"))
}
func Main(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, world!\n")
}