Commit c1b2e1d0 authored by astaxie's avatar astaxie

fix #238

parent 9fc4cd89
......@@ -5,6 +5,7 @@ import (
"github.com/astaxie/beego/session"
"net/http"
"path"
"strings"
)
const VERSION = "0.9.9"
......@@ -36,6 +37,9 @@ func SetViewsPath(path string) *App {
}
func SetStaticPath(url string, path string) *App {
if !strings.HasPrefix(url, "/") {
url = "/" + url
}
StaticDir[url] = path
return BeeApp
}
......
......@@ -8,6 +8,7 @@ import (
"path"
"runtime"
"strconv"
"strings"
)
var (
......@@ -178,6 +179,12 @@ func ParseConfig() (err error) {
if serverName := AppConfig.String("BeegoServerName"); serverName != "" {
BeegoServerName = serverName
}
if sd := AppConfig.String("StaticDir"); sd != "" {
sds := strings.Split(sd, ",")
for _, v := range sds {
StaticDir["/"+v] = v
}
}
}
return nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment