func (interceptor *SessionInterceptor) ServeHTTP(w http.ResponseWriter, r *http.Request) { sess := GlobalSession.SessionStart(w, r) log.Infof("path is %s", r.URL.Path) log.Infof("session id is %s", sess.SessionID()) h, _ := interceptor.Handler(r) h.ServeHTTP(w, r) }
func main() { port := ":9002" http.Handle("/", http.FileServer(http.Dir("static"))) http.Handle("/master/", master.Route()) log.Infof("Server is listening, addr=%s", port) log.Error(http.ListenAndServe(port, nil)) }