Last active
January 28, 2019 18:39
-
-
Save digenaldo/e58e2051ce7fd32514a6019ec3789716 to your computer and use it in GitHub Desktop.
server api
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" | |
"log" | |
"net/http" | |
) | |
func handler(w http.ResponseWriter, r *http.Request) { | |
fmt.Fprint(w, "Hello from the api!") | |
} | |
func main() { | |
http.HandleFunc("/", handler) | |
log.Println("listening on 1354") | |
log.Fatal(http.ListenAndServe(":1354", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment