Skip to content

Instantly share code, notes, and snippets.

@gsingharoy
Last active September 30, 2017 12:29
Show Gist options
  • Save gsingharoy/289bb016dfe46a45230e73f096030b4a to your computer and use it in GitHub Desktop.
Save gsingharoy/289bb016dfe46a45230e73f096030b4a to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"log"
"net/http"
"github.com/julienschmidt/httprouter"
)
func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprint(w, "Welcome!\n")
}
func main() {
router := httprouter.New()
router.GET("/", Index)
log.Fatal(http.ListenAndServe(":8080", router))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment