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

Kestrel vs Iris new benchmarks, as you asked for 👍

Former-commit-id: d8979e55679bbb586dd79a81a43e1c29082ad9c2
This commit is contained in:
kataras
2017-08-21 16:17:32 +03:00
parent 0c403fd0c6
commit 40f79c1f19
8 changed files with 171 additions and 50 deletions

View File

@@ -7,22 +7,8 @@ import (
func main() {
app := iris.New()
// These handlers are serving the same routes as
// `ValuesController`s of netcore-mvc and iris-mvc applications do.
app.Get("/api/values/{id}", getHandler)
app.Put("/api/values/{id}", putHandler)
app.Delete("/api/values/{id}", delHandler)
app.Get("/api/values/{id}", func(ctx context.Context) {
ctx.WriteString("value")
})
app.Run(iris.Addr(":5000"))
}
// getHandler handles "GET" requests to "api/values/{id}".
func getHandler(ctx context.Context) {
// id,_ := vc.Params.GetInt("id")
ctx.WriteString("value")
}
// putHandler handles "PUT" requests to "api/values/{id}".
func putHandler(ctx context.Context) {}
// delHandler handles "DELETE" requests to "api/values/{id}".
func delHandler(ctx context.Context) {}