1
0
mirror of https://github.com/beego/bee.git synced 2024-11-25 20:10:55 +00:00

make docs works when EnableDocs = false

This commit is contained in:
simsun 2015-07-01 23:55:13 +08:00
parent 6c98bdfbbc
commit f50dce1d52

View File

@ -55,6 +55,7 @@ var rootapi swagger.ResourceListing
var apilist map[string]*swagger.ApiDeclaration
func init() {
if beego.EnableDocs {
err := json.Unmarshal([]byte(Rootinfo), &rootapi)
if err != nil {
beego.Error(err)
@ -73,6 +74,7 @@ func init() {
beego.GlobalDocApi[strings.Trim(k, "/")] = v
}
}
}
func urlReplace(src string) string {