Skip to content

Instantly share code, notes, and snippets.

@ninnemana
Created July 31, 2015 19:59
Show Gist options
  • Save ninnemana/7cedd6c9da1cb5baf645 to your computer and use it in GitHub Desktop.
Save ninnemana/7cedd6c9da1cb5baf645 to your computer and use it in GitHub Desktop.
package main
import (
"log"
"net/http"
"github.com/curt-labs/iapi/handlers"
"github.com/julienschmidt/httprouter"
)
func main() {
router := httprouter.New()
router.GET("/status", handlers.Status)
log.Printf("Starting server on %s", ":8080")
http.ListenAndServe(":8080", router)
}
package main
import (
"log"
"net/http"
"github.com/julienschmidt/httprouter"
)
func Status(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
w.Write([]byte("up"))
}
func main() {
router := httprouter.New()
router.GET("/status", Status)
log.Printf("Starting server on %s", ":8080")
http.ListenAndServe(":8080", router)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment