forked from goffee/core
add options for cdn and app
This commit is contained in:
parent
c9cb539d18
commit
5f0ca8e797
4 changed files with 28 additions and 2 deletions
20
core.go
20
core.go
|
|
@ -113,6 +113,26 @@ func (app *App) Run(router *httprouter.Router) {
|
|||
router.ServeFiles("/public/*filepath", http.Dir("storage/public"))
|
||||
}
|
||||
|
||||
// check if app engine is enable
|
||||
AppEnableStr := os.Getenv("APP_ENABLE")
|
||||
if "" == AppEnableStr {
|
||||
AppEnableStr = "false"
|
||||
}
|
||||
AppEnable, _ := strconv.ParseBool(AppEnableStr)
|
||||
if AppEnable {
|
||||
router.ServeFiles("/app/*filepath", http.Dir("storage/app"))
|
||||
}
|
||||
|
||||
// check if app engine is enable
|
||||
CDNEnableStr := os.Getenv("CDN_ENABLE")
|
||||
if "" == CDNEnableStr {
|
||||
CDNEnableStr = "false"
|
||||
}
|
||||
CDNEnable, _ := strconv.ParseBool(CDNEnableStr)
|
||||
if CDNEnable {
|
||||
router.ServeFiles("/cdn/*filepath", http.Dir("storage/cdn"))
|
||||
}
|
||||
|
||||
useHttpsStr := os.Getenv("App_USE_HTTPS")
|
||||
if useHttpsStr == "" {
|
||||
useHttpsStr = "false"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue