Last active
December 15, 2017 04:14
-
-
Save khajer/edc0198c421430cda244cb1119102e64 to your computer and use it in GitHub Desktop.
simple go http server.
This file contains hidden or 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" | |
| "net/http" | |
| ) | |
| func Handler(writer http.ResponseWriter, request *http.Request) { | |
| fmt.Fprintf(writer, "Hello, world ") | |
| } | |
| func main() { | |
| fmt.Println("Server run at : http://127.0.0.1:8080") | |
| http.HandleFunc("/", Handler) | |
| http.ListenAndServe(":8080", nil) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment