1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-09 13:05:56 +00:00

.NET Core vs Iris MVC vs Iris (classic API with Handlers)

Former-commit-id: 19c71f41c0864d2f3f36627e9da53b4802a4476b
This commit is contained in:
kataras
2017-08-19 06:06:05 +03:00
parent b96476d100
commit ca4c66d5b4
14 changed files with 292 additions and 2 deletions

28
_benchmarks/iris/main.go Normal file
View File

@@ -0,0 +1,28 @@
package main
import (
"github.com/kataras/iris"
"github.com/kataras/iris/context"
)
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.Run(iris.Addr(":5000"))
}
// getHandler handles "GET" requests to "api/values/{id}".
func getHandler(ctx context.Context) {
// id,_ := vc.Params.GetInt("id")
ctx.Writef("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) {}