package main
import "github.com/kataras/iris"
func main() {
app := iris.New()
html := iris.HTML("./", ".html")
app.RegisterView(html)
// 处理错误玛
app.OnErrorCode(iris.StatusNotFound,notFound)
app.Run(iris.Addr(":8085"),iris.WithCharset("UTF-8"))
}
func notFound(ctx iris.Context) {
ctx.View("404.html")
}
网友评论