Created
October 10, 2015 05:03
-
-
Save nu1silva/e1477c06277b491c70fe to your computer and use it in GitHub Desktop.
golang_http_server
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 | |
// 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