Skip to content

Instantly share code, notes, and snippets.

@subudear
Created July 29, 2021 22:10
Show Gist options
  • Save subudear/26c47ba4e36adc9a179f90a908bf6d9b to your computer and use it in GitHub Desktop.
Save subudear/26c47ba4e36adc9a179f90a908bf6d9b to your computer and use it in GitHub Desktop.
package main
import "fmt"
import "net/http"
func index(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "<h1>Hello World</h1>")
}
func health(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "<h1>Health Check Pass</h1>")
}
func main() {
http.HandleFunc("/",index)
http.HandleFunc("/health",health)
fmt.Println("Server Starting...")
http.ListenAndServe(":8080",nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment