server/http.go

13 lines
237 B
Go
Raw Normal View History

2013-08-28 23:46:12 -07:00
package main
import (
"net/http"
)
type JsonHandler func(http.ResponseWriter, *http.Request)
func (h JsonHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
w.Header().Set("Content-Type", "application/json")
h(w, req)
}