45710c3a by xiemengjun

add TemplateCache

1 parent 8e90ddd5
Showing 1 changed file with 3 additions and 0 deletions
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
4 "fmt" 4 "fmt"
5 "github.com/astaxie/session" 5 "github.com/astaxie/session"
6 _ "github.com/astaxie/session/providers/memory" 6 _ "github.com/astaxie/session/providers/memory"
7 "html/template"
7 "net/http" 8 "net/http"
8 "os" 9 "os"
9 "path" 10 "path"
...@@ -15,6 +16,7 @@ var ( ...@@ -15,6 +16,7 @@ var (
15 AppName string 16 AppName string
16 AppPath string 17 AppPath string
17 StaticDir map[string]string 18 StaticDir map[string]string
19 TemplateCache map[string]*template.Template
18 HttpAddr string 20 HttpAddr string
19 HttpPort int 21 HttpPort int
20 RecoverPanic bool 22 RecoverPanic bool
...@@ -36,6 +38,7 @@ func init() { ...@@ -36,6 +38,7 @@ func init() {
36 BeeApp = NewApp() 38 BeeApp = NewApp()
37 AppPath, _ = os.Getwd() 39 AppPath, _ = os.Getwd()
38 StaticDir = make(map[string]string) 40 StaticDir = make(map[string]string)
41 TemplateCache = make(map[string]*template.Template)
39 var err error 42 var err error
40 AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf")) 43 AppConfig, err = LoadConfig(path.Join(AppPath, "conf", "app.conf"))
41 if err != nil { 44 if err != nil {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!