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
02eacb8e
Commit
02eacb8e
authored
Dec 14, 2013
by
Francois
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update config.go
parent
2a4459b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
config.go
config.go
+20
-0
No files found.
config.go
View file @
02eacb8e
...
...
@@ -19,6 +19,7 @@ var (
AppConfigPath
string
StaticDir
map
[
string
]
string
TemplateCache
map
[
string
]
*
template
.
Template
StaticExtensionsToGzip
[]
string
//Files which should also be compressed with gzip (.js, .css, etc)
HttpAddr
string
HttpPort
int
HttpTLS
bool
...
...
@@ -69,6 +70,8 @@ func init() {
StaticDir
=
make
(
map
[
string
]
string
)
StaticDir
[
"/static"
]
=
"static"
StaticExtensionsToGzip
=
[]
string
{
".css"
,
".js"
}
TemplateCache
=
make
(
map
[
string
]
*
template
.
Template
)
// set this to 0.0.0.0 to make this app available to externally
...
...
@@ -274,6 +277,23 @@ func ParseConfig() (err error) {
}
}
if
sgz
:=
AppConfig
.
String
(
"StaticExtensionsToGzip"
);
sgz
!=
""
{
extensions
:=
strings
.
Split
(
sgz
,
","
)
if
len
(
extensions
)
>
0
{
StaticExtensionsToGzip
=
[]
string
{}
for
_
,
ext
:=
range
extensions
{
if
len
(
ext
)
==
0
{
continue
}
extWithDot
:=
ext
if
extWithDot
[
:
1
]
!=
"."
{
extWithDot
=
"."
+
extWithDot
}
StaticExtensionsToGzip
=
append
(
StaticExtensionsToGzip
,
extWithDot
)
}
}
}
if
enableadmin
,
err
:=
AppConfig
.
Bool
(
"EnableAdmin"
);
err
==
nil
{
EnableAdmin
=
enableadmin
}
...
...
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