mirror of
https://github.com/kataras/iris.git
synced 2026-01-10 05:25:58 +00:00
examples: replace all app.Run(iris.Addr(...)) with app.Listen just for the shake of simplicity, both are doing the same exact thing as it's described on the http listening first example.
Former-commit-id: d20afb2e899aee658a8e0ed1693357798df93462
This commit is contained in:
@@ -110,5 +110,5 @@ func newApp() *iris.Application {
|
||||
|
||||
func main() {
|
||||
app := newApp()
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -18,5 +18,5 @@ func main() {
|
||||
app := newApp()
|
||||
// http://localhost:8080
|
||||
// http://localhost:8080/yourname
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func main() {
|
||||
})
|
||||
}() // ...
|
||||
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
|
||||
}
|
||||
|
||||
/* For a golang SSE client you can look at: https://github.com/r3labs/sse#example-client */
|
||||
|
||||
@@ -187,5 +187,5 @@ func main() {
|
||||
|
||||
// http://localhost:8080
|
||||
// http://localhost:8080/events
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ func main() {
|
||||
}
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -50,5 +50,5 @@ func main() {
|
||||
"not been shown. But it has a transient scope(default) so, it is visible as expected!</h1>")
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@ func main() {
|
||||
ctx.GzipResponseWriter().WriteString("Hello World!")
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -91,5 +91,5 @@ func main() {
|
||||
//
|
||||
// `iris.WithoutServerError` is an optional configurator,
|
||||
// if passed to the `Run` then it will not print its passed error as an actual server error.
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
|
||||
app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user