diff options
author | Doug Black <dblack@twilio.com> | 2014-03-29 23:26:34 -0700 |
---|---|---|
committer | Doug Black <dblack@twilio.com> | 2014-03-29 23:26:34 -0700 |
commit | e23c5c65d0139c54d0a88907b7d418152f07cd2f (patch) | |
tree | 949cf91390ed92174119951239fed71dddd5273e | |
parent | update AUTHORS.md (diff) | |
download | sleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.tar.gz sleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.tar.bz2 sleepy-e23c5c65d0139c54d0a88907b7d418152f07cd2f.zip |
update README
-rw-r--r-- | README.md | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -9,21 +9,22 @@ package main import ( "net/url" + "net/http" "github.com/dougblack/sleepy" ) type Item struct { } -func (item Item) Get(values url.Values, headers map[string][]string) (int, interface{}, map[string][]string) { +func (item Item) Get(values url.Values, headers http.Header) (int, interface{}, http.Header) { items := []string{"item1", "item2"} data := map[string][]string{"items": items} - return 200, data, map[string][]string{"Content-type": {"application/json"}} + return 200, data, http.Header{"Content-type": {"application/json"}} } func main() { item := new(Item) - var api = sleepy.NewAPI() + api := sleepy.NewAPI() api.AddResource(item, "/items") api.Start(3000) } |