Skip to content

Instantly share code, notes, and snippets.

@WolvenSpirit
Created December 21, 2018 19:40
Show Gist options
  • Save WolvenSpirit/b26a0143f55a3a19c20cd4ca6a937101 to your computer and use it in GitHub Desktop.
Save WolvenSpirit/b26a0143f55a3a19c20cd4ca6a937101 to your computer and use it in GitHub Desktop.
package main
import ("fmt"
"net/http")
func server(){
http.HandleFunc("/",index_handler)
http.HandleFunc("/links",links_handler)
http.ListenAndServe("127.0.0.1:8000", nil)
}
// r reader points to request
func index_handler(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w,"Live...!")
}
func links_handler(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w,"<a href=http://core.litedesign.net>core.litedesign.net</a>")
}
func main(){
server()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment