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
02eacb8e
authored
2013-12-14 20:34:27 +0200
by
Francois
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update config.go
1 parent
2a4459b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
config.go
config.go
View file @
02eacb8
...
...
@@ -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
...
...
@@ -68,6 +69,8 @@ func init() {
StaticDir
=
make
(
map
[
string
]
string
)
StaticDir
[
"/static"
]
=
"static"
StaticExtensionsToGzip
=
[]
string
{
".css"
,
".js"
}
TemplateCache
=
make
(
map
[
string
]
*
template
.
Template
)
...
...
@@ -273,6 +276,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
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