Can't seem to find any useful examples. can anyone point me to some examples online for restful api?
Hello @unisqu ,
Iris version 5 is fasthttp-based. It is the only one web framework that supports websocket, sessions and all that out-of-the-box, in fact it was the first web framework that was based in fasthttp back then so I had to do all the hard work for those things. Iris v5 is not active now, like the fasthttp itself but you can still use it and read its examples to learn more.
Upload file example that you were looking for: https://github.com/iris-contrib/examples/blob/5.0.0/file_upload_simple
Iris v5 repository: https://github.com/kataras/iris/tree/5.0.0#quick-start
Sincerely,
Gerasimos Maropoulos, Author of the Iris web framework
the main reason i'm not using iris is this
https://dizzy.zone/2018/01/23/Kestrel-vs-Gin-vs-Iris-on-EC2/
seems like a bloated ware slowing down a lot of things.
i'm trying to use fasthttp as miminal as it can be for rest api development.
I also agree that if you don't have to use a framework then don't use one. Less dependencies is always better!
The usage is something like this:
func handler(ctx *fasthttp.RequestCtx) {
fh, err := ctx.FormFile("filekey")
if err != nil {
panic(err)
}
if err := fasthttp.SaveMultipartFile(fr, "filename.ext"); err != nil {
panic(err)
}
}
I didn't say that you must use Iris, just check its code and you will learn a lot about fasthttp from iris v5 :)
About @unisqu, don't trust benchmarks without code. I am always posting results with the benchmark test code and the process I follow including the benchmarking tools. For example, in the iris readme you can find updated benchmarks (22 october 2018) which compares latest versions of iris (11) and .NET Core Kestrel (2.1.5, which indeed has a lot of performance boost this time, some prorgrammers from microsoft told that Iris itself helped them a lot, you can find more at twitter), and as always the process we follow is described at: https://github.com/kataras/iris/tree/master/_benchmarks/README.md. Of course there are third-party benchmarks that can show you Iris still faster than alternatives, including .NET Core (https://github.com/kataras/iris#iris-vs-the-rest-go-web-frameworks-and-routers-vs-any-other-alternative). Have fun mate!
Most helpful comment
I also agree that if you don't have to use a framework then don't use one. Less dependencies is always better!
The usage is something like this: