aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md7
1 files changed, 4 insertions, 3 deletions
diff --git a/README.md b/README.md
index 4c5ceb7..eacf343 100644
--- a/README.md
+++ b/README.md
@@ -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)
}
bgstack15