Host
Listen and Serve
import "github.com/kataras/iris/v12"app := iris.New()
// Listening on tcp with network address 0.0.0.0:8080.
//
// Listen is a shortcut for app.Run(iris.Addr(":8080")).
app.Listen(":8080")import "net/http"// Same as before but using a custom http.Server which may being used somewhere else too
server := &http.Server{Addr:":8080" /* other fields here */}
app.Run(iris.Server(server))// Using a custom net.Listener
l, err := net.Listen("tcp4", ":8080")
if err != nil {
panic(err)
}
app.Run(iris.Listener(l))HTTP/2 and Secure
Any iris.Runner
iris.RunnerHost configurators
Multi hosts
Shutdown (Gracefully)
Last updated
Was this helpful?