func MyNotFound(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
w.WriteHeader(http.StatusNotFound) // StatusNotFound = 404
w.Write([]byte("My own Not Found handler."))
w.Write([]byte(" The page you requested could not be found."))
}
func RunServer(host string) error {
router := httprouter.New()
router.GET("/sdk/ws/", WSHandler)
router.GET("/sdk/ajax/:data", AjaxHandler)
router.GET("/sdk/jsonp/:data", JsonpHandler)
router.ServeFiles("/p/*filepath", http.Dir("public/"))
router.NotFound = MyNotFound
return http.ListenAndServe(host, router)
}