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
fe3a224a
Commit
fe3a224a
authored
Jun 16, 2017
by
astaxie
Committed by
GitHub
Jun 16, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2724 from JessonChan/develop
AddAPPStartHook func modify
parents
2754edc8
a87c1c5e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
beego.go
beego.go
+11
-9
No files found.
beego.go
View file @
fe3a224a
...
...
@@ -40,9 +40,9 @@ var (
// AddAPPStartHook is used to register the hookfunc
// The hookfuncs will run in beego.Run()
// such as
sessionInit, middlerware start, buildtemplate, admin start
func
AddAPPStartHook
(
hf
hookfunc
)
{
hooks
=
append
(
hooks
,
hf
)
// such as
initiating session , starting middleware , building template, starting admin control and so on.
func
AddAPPStartHook
(
hf
...
hookfunc
)
{
hooks
=
append
(
hooks
,
hf
...
)
}
// Run beego application.
...
...
@@ -69,12 +69,14 @@ func Run(params ...string) {
func
initBeforeHTTPRun
()
{
//init hooks
AddAPPStartHook
(
registerMime
)
AddAPPStartHook
(
registerDefaultErrorHandler
)
AddAPPStartHook
(
registerSession
)
AddAPPStartHook
(
registerTemplate
)
AddAPPStartHook
(
registerAdmin
)
AddAPPStartHook
(
registerGzip
)
AddAPPStartHook
(
registerMime
,
registerDefaultErrorHandler
,
registerSession
,
registerTemplate
,
registerAdmin
,
registerGzip
,
)
for
_
,
hk
:=
range
hooks
{
if
err
:=
hk
();
err
!=
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