1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-19 02:27:03 +00:00

Added partial templates

mailbox/list now renders
This commit is contained in:
James Hillyerd
2012-10-21 12:42:54 -07:00
parent 9c94bb2ab1
commit 71bb52a64a
17 changed files with 238 additions and 147 deletions

View File

@@ -31,17 +31,19 @@ var Router *mux.Router
var sessionStore sessions.Store
func setupRoutes(cfg inbucket.WebConfig) {
r := mux.NewRouter()
Router = r
Router = mux.NewRouter()
inbucket.Info("Theme templates mapped to '%v'", cfg.TemplateDir)
inbucket.Info("Theme static content mapped to '%v'", cfg.PublicDir)
r := Router
// Static content
r.PathPrefix("/public/").Handler(http.StripPrefix("/public/",
http.FileServer(http.Dir(cfg.PublicDir))))
// Root
r.Path("/").Handler(handler(RootIndex))
r.Path("/").Handler(handler(RootIndex)).Name("RootIndex").Methods("GET")
r.Path("/mailbox").Handler(handler(MailboxIndex)).Name("MailboxIndex").Methods("GET")
r.Path("/mailbox/list/{name}").Handler(handler(MailboxList)).Name("MailboxList").Methods("GET")
}
// Start() the web server