This commit is contained in:
Sameer Dev 2024-04-23 15:50:38 +05:30
parent 2ee9b00258
commit 2118732d78
3 changed files with 48 additions and 0 deletions

26
fc.toml Normal file
View File

@ -0,0 +1,26 @@
app = "golang-buildpack-app-sample"
region = "asia-south1"
handler = ""
[build]
buildpack_builder = "paketobuildpacks/builder-jammy-base"
buildpacks = ["paketo-buildpacks/go"]
ignorefile = ".gitignore"
[build.args]
foo = "bar"
[env]
FOO = "BAR"
[http_service]
internal_port = 3000
[[http_service.checks]]
interval = "1m21s"
timeout = "7s"
grace_period = "2s"
method = "GET"
path = "/"
protocol = "http"
[http_service.checks.headers]
My-Custom-Header = "whatever"

3
go.mod Normal file
View File

@ -0,0 +1,3 @@
module golang-buildpack-app-sample
go 1.21.5

19
main.go Normal file
View File

@ -0,0 +1,19 @@
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello World!")
}
func main() {
// Register the handler function to handle requests to "/"
http.HandleFunc("/", handler)
// Start the HTTP server on port 3000
fmt.Println("Example app listening on port 3000!")
http.ListenAndServe(":3000", nil)
}