Created
December 21, 2018 19:40
-
-
Save WolvenSpirit/b26a0143f55a3a19c20cd4ca6a937101 to your computer and use it in GitHub Desktop.
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 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