Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 309 Bytes

using-handlers.md

File metadata and controls

19 lines (13 loc) · 309 Bytes

Using Handlers

type myHandlerGet struct {
}

func (m myHandlerGet) Serve(c *iris.Context) {
    c.Write("From %s", c.PathString())
}

//and so on


iris.Handle("GET", "/get", myHandlerGet{})
iris.Handle("POST", "/post", post)
iris.Handle("PUT", "/put", put)
iris.Handle("DELETE", "/delete", del)