summaryrefslogtreecommitdiff
path: root/system/admin/server.go
diff options
context:
space:
mode:
authorSteve <nilslice@gmail.com>2016-12-12 00:34:46 -0800
committerGitHub <noreply@github.com>2016-12-12 00:34:46 -0800
commite7c23d71d5179744c230ab4e25f405a5607ba905 (patch)
tree758eba1275e1436220281fd45e3ad642fcda4598 /system/admin/server.go
parentf39c1519ab382a343c05163f00f38c83bff3583d (diff)
parent3b10b345045428b9011eecd0ded9c04db42bf28f (diff)
Merge pull request #20 from bosssauce/ponzu-dev
[core] cache-control & db specifier namespace clean-up
Diffstat (limited to 'system/admin/server.go')
-rw-r--r--system/admin/server.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/system/admin/server.go b/system/admin/server.go
index f80a750..bc6f4d6 100644
--- a/system/admin/server.go
+++ b/system/admin/server.go
@@ -7,6 +7,8 @@ import (
"path/filepath"
"github.com/bosssauce/ponzu/system/admin/user"
+ "github.com/bosssauce/ponzu/system/api"
+ "github.com/bosssauce/ponzu/system/db"
)
// Run adds Handlers to default http listener for Admin
@@ -41,11 +43,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/", api.Record(db.CacheControl(http.StripPrefix("/api/uploads/", http.FileServer(restrict(http.Dir(uploadsDir)))))))
}