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
5a9bff20
Commit
5a9bff20
authored
Mar 17, 2016
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init gzip level
parent
48147f50
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
beego.go
beego.go
+5
-3
hooks.go
hooks.go
+8
-0
No files found.
beego.go
View file @
5a9bff20
...
@@ -22,12 +22,12 @@ import (
...
@@ -22,12 +22,12 @@ import (
)
)
const
(
const
(
// VERSION represent beego web framework version.
// VERSION represent beego web framework version.
VERSION
=
"1.6.1"
VERSION
=
"1.6.1"
// DEV is for develop
// DEV is for develop
DEV
=
"dev"
DEV
=
"dev"
// PROD is for production
// PROD is for production
PROD
=
"prod"
PROD
=
"prod"
)
)
...
@@ -51,6 +51,7 @@ func AddAPPStartHook(hf hookfunc) {
...
@@ -51,6 +51,7 @@ func AddAPPStartHook(hf hookfunc) {
// beego.Run(":8089")
// beego.Run(":8089")
// beego.Run("127.0.0.1:8089")
// beego.Run("127.0.0.1:8089")
func
Run
(
params
...
string
)
{
func
Run
(
params
...
string
)
{
initBeforeHTTPRun
()
initBeforeHTTPRun
()
if
len
(
params
)
>
0
&&
params
[
0
]
!=
""
{
if
len
(
params
)
>
0
&&
params
[
0
]
!=
""
{
...
@@ -74,6 +75,7 @@ func initBeforeHTTPRun() {
...
@@ -74,6 +75,7 @@ func initBeforeHTTPRun() {
AddAPPStartHook
(
registerDocs
)
AddAPPStartHook
(
registerDocs
)
AddAPPStartHook
(
registerTemplate
)
AddAPPStartHook
(
registerTemplate
)
AddAPPStartHook
(
registerAdmin
)
AddAPPStartHook
(
registerAdmin
)
AddAPPStartHook
(
registerGzip
)
for
_
,
hk
:=
range
hooks
{
for
_
,
hk
:=
range
hooks
{
if
err
:=
hk
();
err
!=
nil
{
if
err
:=
hk
();
err
!=
nil
{
...
...
hooks.go
View file @
5a9bff20
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"net/http"
"net/http"
"path/filepath"
"path/filepath"
"github.com/astaxie/beego/context"
"github.com/astaxie/beego/session"
"github.com/astaxie/beego/session"
)
)
...
@@ -91,3 +92,10 @@ func registerAdmin() error {
...
@@ -91,3 +92,10 @@ func registerAdmin() error {
}
}
return
nil
return
nil
}
}
func
registerGzip
()
error
{
if
BConfig
.
EnableGzip
{
context
.
InitGzip
(
AppConfig
)
}
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