Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
383a04f4
Commit
383a04f4
authored
Dec 30, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move initmime from beego.Run to hookfunc
parent
eea27248
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
beego.go
beego.go
+2
-3
mime.go
mime.go
+2
-1
No files found.
beego.go
View file @
383a04f4
...
...
@@ -18,6 +18,8 @@ var hooks []hookfunc //hook function slice to store the hookfunc
func
init
()
{
hooks
=
make
([]
hookfunc
,
0
)
//init mime
AddAPPStartHook
(
initMime
)
}
// Router adds a patterned controller handler to BeeApp.
...
...
@@ -112,9 +114,6 @@ func Run() {
}
}
//init mime
initMime
()
// do hooks function
for
_
,
hk
:=
range
hooks
{
err
:=
hk
()
...
...
mime.go
View file @
383a04f4
...
...
@@ -544,8 +544,9 @@ var mimemaps map[string]string = map[string]string{
".mustache"
:
"text/html"
,
}
func
initMime
()
{
func
initMime
()
error
{
for
k
,
v
:=
range
mimemaps
{
mime
.
AddExtensionType
(
k
,
v
)
}
return
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment