diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-12-06 17:53:57 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-12-06 17:53:57 -0800 |
commit | f2fc4db1ea0dbf4a1f75fb3e52b64e6f529e5e44 (patch) | |
tree | 7883ac215fd18966b8a1919c24339ec430bddac3 /system/api/server.go | |
parent | 64050ef8065bccdef0aab1748040995c637fe9ed (diff) |
adding cache (client-based, Etag) to API responses in addition to static files uploaded
Diffstat (limited to 'system/api/server.go')
-rw-r--r-- | system/api/server.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/system/api/server.go b/system/api/server.go index 823ec16..41d652a 100644 --- a/system/api/server.go +++ b/system/api/server.go @@ -2,15 +2,17 @@ package api import ( "net/http" + + "github.com/bosssauce/ponzu/system/db" ) // Run adds Handlers to default http listener for API func Run() { - http.HandleFunc("/api/types", CORS(Record(typesHandler))) + http.HandleFunc("/api/types", db.CacheControl(CORS(Record(typesHandler)))) - http.HandleFunc("/api/contents", CORS(Record(contentsHandler))) + http.HandleFunc("/api/contents", db.CacheControl(CORS(Record(contentsHandler)))) - http.HandleFunc("/api/content", CORS(Record(contentHandler))) + http.HandleFunc("/api/content", db.CacheControl(CORS(Record(contentHandler)))) - http.HandleFunc("/api/content/external", CORS(Record(externalContentHandler))) + http.HandleFunc("/api/content/external", db.CacheControl(CORS(Record(externalContentHandler)))) } |