golang-buildpack-app-sample/main.go
2024-04-23 15:50:38 +05:30

20 lines
369 B
Go

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)
}