mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 18:56:29 +01:00
update for v12.1.1
parent
83b562f191
commit
952906eb2a
|
@ -21,7 +21,7 @@ module your_project_name
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/kataras/iris/v12 v12.1.0
|
github.com/kataras/iris/v12 v12.1.1
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,20 @@ func notFound(ctx iris.Context) {
|
||||||
// when 404 then render the template
|
// when 404 then render the template
|
||||||
// $views_dir/errors/404.html
|
// $views_dir/errors/404.html
|
||||||
ctx.View("errors/404.html")
|
ctx.View("errors/404.html")
|
||||||
|
|
||||||
|
// OR, if you had more paths and you want
|
||||||
|
// to suggest relative paths to the user:
|
||||||
|
// suggestPaths := ctx.FindClosest(3)
|
||||||
|
// if len(suggestPaths) == 0 {
|
||||||
|
// ctx.WriteString("404 not found")
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
// ctx.HTML("Did you mean?<ul>")
|
||||||
|
// for _, s := range suggestPaths {
|
||||||
|
// ctx.HTML(`<li><a href="%s">%s</a></li>`, s, s)
|
||||||
|
// }
|
||||||
|
// ctx.HTML("</ul>")
|
||||||
}
|
}
|
||||||
|
|
||||||
func internalServerError(ctx iris.Context) {
|
func internalServerError(ctx iris.Context) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user