Skip to content

Instantly share code, notes, and snippets.

@shijuvar
Created January 20, 2016 11:50
Show Gist options
  • Save shijuvar/85f96c913addb44365ec to your computer and use it in GitHub Desktop.
Save shijuvar/85f96c913addb44365ec to your computer and use it in GitHub Desktop.
HTTP Server with http.HandleFunc
package main
import (
"fmt"
"log"
"net/http"
)
func indexHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Welcome to Go Web Development")
}
func main() {
http.HandleFunc("/", indexHandler)
log.Println("Listening...")
http.ListenAndServe(":8080", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment