1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 10:27:06 +00:00

add Party.RemoveRoute method as requested in the community chat

This commit is contained in:
Gerasimos (Makis) Maropoulos
2021-04-04 20:24:21 +03:00
parent 968dd846c2
commit ce6c455601
6 changed files with 84 additions and 19 deletions

View File

@@ -0,0 +1,24 @@
package main
import (
"github.com/kataras/iris/v12"
)
func main() {
app := iris.New()
app.Get("/", index)
app.Get("/about", about).SetName("about_page")
app.RemoveRoute("about_page")
// http://localhost:8080
// http://localhost:8080/about (Not Found)
app.Listen(":8080")
}
func index(ctx iris.Context) {
ctx.WriteString("Hello, Gophers!")
}
func about(ctx iris.Context) {
ctx.HTML("<h1>About Page</h1>")
}