Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
383a04f4
authored
2013-12-31 00:34:47 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
move initmime from beego.Run to hookfunc
1 parent
eea27248
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
beego.go
mime.go
beego.go
View file @
383a04f
...
...
@@ -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 @
383a04f
...
...
@@ -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
Styling with
Markdown
is supported
Attach a file
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 post a comment