Commit 383a04f4 authored by astaxie's avatar astaxie

move initmime from beego.Run to hookfunc

parent eea27248
...@@ -18,6 +18,8 @@ var hooks []hookfunc //hook function slice to store the hookfunc ...@@ -18,6 +18,8 @@ var hooks []hookfunc //hook function slice to store the hookfunc
func init() { func init() {
hooks = make([]hookfunc, 0) hooks = make([]hookfunc, 0)
//init mime
AddAPPStartHook(initMime)
} }
// Router adds a patterned controller handler to BeeApp. // Router adds a patterned controller handler to BeeApp.
...@@ -112,9 +114,6 @@ func Run() { ...@@ -112,9 +114,6 @@ func Run() {
} }
} }
//init mime
initMime()
// do hooks function // do hooks function
for _, hk := range hooks { for _, hk := range hooks {
err := hk() err := hk()
......
...@@ -544,8 +544,9 @@ var mimemaps map[string]string = map[string]string{ ...@@ -544,8 +544,9 @@ var mimemaps map[string]string = map[string]string{
".mustache": "text/html", ".mustache": "text/html",
} }
func initMime() { func initMime() error {
for k, v := range mimemaps { for k, v := range mimemaps {
mime.AddExtensionType(k, v) mime.AddExtensionType(k, v)
} }
return nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment