Skip to content

Instantly share code, notes, and snippets.

@nu1silva
Created October 10, 2015 05:03
Show Gist options
  • Save nu1silva/e1477c06277b491c70fe to your computer and use it in GitHub Desktop.
Save nu1silva/e1477c06277b491c70fe to your computer and use it in GitHub Desktop.
golang_http_server
package main
// Imports fmt and net/http packages
import "fmt"
import "net/http"
// Create a basic handler
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "It's Alive!!!")
}
// main function
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":8000", nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment