Skip to content

Instantly share code, notes, and snippets.

@percybolmer
Created August 2, 2022 05:58
Show Gist options
  • Save percybolmer/b487b1cb99b073bd29e27041385c5bf1 to your computer and use it in GitHub Desktop.
Save percybolmer/b487b1cb99b073bd29e27041385c5bf1 to your computer and use it in GitHub Desktop.
Simple http server to use while learning docker
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "hello gopher")
})
http.HandleFunc("/aligator", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi Mr Aligator")
})
log.Fatal(http.ListenAndServe(":8080", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment