1 Star 0 Fork 56

why-mao / GoMD

forked from xuthus / GoMD 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 667 Bytes
一键复制 编辑 原始数据 按行查看 历史
xuthus 提交于 2018-09-25 21:16 . 重置仓库
package main
import (
_ "GoMD/routers"
"github.com/astaxie/beego"
"html/template"
"net/http"
)
//自定义404报错
func PageNotFound(rw http.ResponseWriter, r *http.Request){
t,_:= template.New("404.html").ParseFiles(beego.BConfig.WebConfig.ViewsPath+"/default/404.html")
data := make(map[string]interface{})
data["code"] = "404"
data["title"] = "页面被吃掉了!"
t.Execute(rw, data)
}
func main() {
// 运行时
beego.AddFuncMap("tags", Tags)
beego.AddFuncMap("calc", Calc)
beego.AddFuncMap("markdown", MarkDown)
beego.AddFuncMap("time", YMD)
beego.AddFuncMap("tableNum", TableNumber)
beego.ErrorHandler("404",PageNotFound)
beego.Run()
}
Go
1
https://gitee.com/maoyikun2015/GoMD.git
git@gitee.com:maoyikun2015/GoMD.git
maoyikun2015
GoMD
GoMD
master

搜索帮助