1 Star 0 Fork 0

sonysoul / iris

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
main.go 638 Bytes
Copy Edit Raw Blame History
package main
import "github.com/kataras/iris"
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.WriteGzip([]byte("Hello World!"))
ctx.Header("X-Custom",
"Headers can be set here after WriteGzip as well, because the data are kept before sent to the client when using the context's GzipResponseWriter and ResponseRecorder.")
})
app.Get("/2", func(ctx iris.Context) {
// same as the `WriteGzip`.
// However GzipResponseWriter gives you more options, like
// reset data, disable and more, look its methods.
ctx.GzipResponseWriter().WriteString("Hello World!")
})
app.Run(iris.Addr(":8080"))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sonysoul/iris.git
git@gitee.com:sonysoul/iris.git
sonysoul
iris
iris
v10.1.0

Search

344bd9b3 5694891 D2dac590 5694891