Skip to content

Instantly share code, notes, and snippets.

@digenaldo
Last active January 28, 2019 18:39
Show Gist options
  • Save digenaldo/e58e2051ce7fd32514a6019ec3789716 to your computer and use it in GitHub Desktop.
Save digenaldo/e58e2051ce7fd32514a6019ec3789716 to your computer and use it in GitHub Desktop.
server api
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