Created
July 29, 2021 22:10
-
-
Save subudear/26c47ba4e36adc9a179f90a908bf6d9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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