summaryrefslogtreecommitdiff
path: root/system/admin/server.go
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-12-06 17:53:57 -0800
committerSteve Manuel <nilslice@gmail.com>2016-12-06 17:53:57 -0800
commitf2fc4db1ea0dbf4a1f75fb3e52b64e6f529e5e44 (patch)
tree7883ac215fd18966b8a1919c24339ec430bddac3 /system/admin/server.go
parent64050ef8065bccdef0aab1748040995c637fe9ed (diff)
adding cache (client-based, Etag) to API responses in addition to static files uploaded
Diffstat (limited to 'system/admin/server.go')
-rw-r--r--system/admin/server.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/system/admin/server.go b/system/admin/server.go
index f80a750..3568818 100644
--- a/system/admin/server.go
+++ b/system/admin/server.go
@@ -7,6 +7,7 @@ import (
"path/filepath"
"github.com/bosssauce/ponzu/system/admin/user"
+ "github.com/bosssauce/ponzu/system/db"
)
// Run adds Handlers to default http listener for Admin
@@ -41,11 +42,11 @@ func Run() {
}
staticDir := filepath.Join(pwd, "cmd", "ponzu", "vendor", "github.com", "bosssauce", "ponzu", "system")
- http.Handle("/admin/static/", CacheControl(http.FileServer(restrict(http.Dir(staticDir)))))
+ http.Handle("/admin/static/", db.CacheControl(http.FileServer(restrict(http.Dir(staticDir)))))
// API path needs to be registered within server package so that it is handled
// even if the API server is not running. Otherwise, images/files uploaded
// through the editor will not load within the admin system.
uploadsDir := filepath.Join(pwd, "uploads")
- http.Handle("/api/uploads/", CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir))))))
+ http.Handle("/api/uploads/", db.CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir))))))
}