diff --git a/README_ES.md b/README_ES.md
index 28d06057..4f037d32 100644
--- a/README_ES.md
+++ b/README_ES.md
@@ -33,7 +33,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/README_FA.md b/README_FA.md
index b3310677..6ec32b13 100644
--- a/README_FA.md
+++ b/README_FA.md
@@ -48,7 +48,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/README_GR.md b/README_GR.md
index 5ef819fa..295e357a 100644
--- a/README_GR.md
+++ b/README_GR.md
@@ -33,7 +33,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/README_KO.md b/README_KO.md
index 5082f636..2dffbaa9 100644
--- a/README_KO.md
+++ b/README_KO.md
@@ -31,7 +31,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/README_RU.md b/README_RU.md
index c1905928..53a16b2c 100644
--- a/README_RU.md
+++ b/README_RU.md
@@ -31,7 +31,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/README_ZH.md b/README_ZH.md
index 1bf2076f..09ca9831 100644
--- a/README_ZH.md
+++ b/README_ZH.md
@@ -31,7 +31,7 @@ func main() {
})
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
diff --git a/_benchmarks/iris-mvc-templates/main.go b/_benchmarks/iris-mvc-templates/main.go
index a572810f..9c96e904 100644
--- a/_benchmarks/iris-mvc-templates/main.go
+++ b/_benchmarks/iris-mvc-templates/main.go
@@ -24,7 +24,7 @@ func main() {
mvc.New(app).Handle(new(controllers.HomeController))
- app.Run(iris.Addr(":5000"))
+ app.Listen(":5000")
}
type err struct {
diff --git a/_benchmarks/iris-sessions/main.go b/_benchmarks/iris-sessions/main.go
index f84e1f07..c380b3fe 100644
--- a/_benchmarks/iris-sessions/main.go
+++ b/_benchmarks/iris-sessions/main.go
@@ -24,7 +24,7 @@ func main() {
app.Delete("/del", delHandler)
*/
- app.Run(iris.Addr(":5000"))
+ app.Listen(":5000")
}
// Set and Get
diff --git a/_examples/README_ZH.md b/_examples/README_ZH.md
index 865557f8..8afcea4e 100644
--- a/_examples/README_ZH.md
+++ b/_examples/README_ZH.md
@@ -153,7 +153,7 @@ import (
func main() {
app := iris.New()
mvc.Configure(app.Party("/root"), myMVC)
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func myMVC(app *mvc.Application) {
diff --git a/_examples/apidoc/yaag/main.go b/_examples/apidoc/yaag/main.go
index 2a69a211..a50b346c 100644
--- a/_examples/apidoc/yaag/main.go
+++ b/_examples/apidoc/yaag/main.go
@@ -51,5 +51,5 @@ func main() {
//
// Example usage:
// Visit all paths and open the generated "apidoc.html" file to see the API's automated docs.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/authentication/basicauth/main.go b/_examples/authentication/basicauth/main.go
index 643d3e03..cfc279f0 100644
--- a/_examples/authentication/basicauth/main.go
+++ b/_examples/authentication/basicauth/main.go
@@ -45,7 +45,7 @@ func newApp() *iris.Application {
func main() {
app := newApp()
// open http://localhost:8080/admin
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func h(ctx iris.Context) {
diff --git a/_examples/authentication/oauth2/main.go b/_examples/authentication/oauth2/main.go
index b16702d5..4bf638e3 100644
--- a/_examples/authentication/oauth2/main.go
+++ b/_examples/authentication/oauth2/main.go
@@ -400,7 +400,7 @@ func main() {
})
// http://localhost:3000
- app.Run(iris.Addr("localhost:3000"))
+ app.Listen("localhost:3000")
}
type ProviderIndex struct {
diff --git a/_examples/cache/client-side/main.go b/_examples/cache/client-side/main.go
index 31e7aefe..f460b463 100644
--- a/_examples/cache/client-side/main.go
+++ b/_examples/cache/client-side/main.go
@@ -30,7 +30,7 @@ func main() {
// })
app.Get("/", greet)
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func greet(ctx iris.Context) {
diff --git a/_examples/cache/simple/main.go b/_examples/cache/simple/main.go
index 49e46567..010c3511 100644
--- a/_examples/cache/simple/main.go
+++ b/_examples/cache/simple/main.go
@@ -63,7 +63,7 @@ func main() {
// saves its content on the first request and serves it instead of re-calculating the content.
// After 10 seconds it will be cleared and reset.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func writeMarkdown(ctx iris.Context) {
diff --git a/_examples/configuration/README.md b/_examples/configuration/README.md
index 6cfad96b..3fae71e5 100644
--- a/_examples/configuration/README.md
+++ b/_examples/configuration/README.md
@@ -26,7 +26,7 @@ func main() {
// [...]
// Good when you want to modify the whole configuration.
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.Configuration{
+ app.Listen(":8080", iris.WithConfiguration(iris.Configuration{
DisableStartupLog: false,
DisableInterruptHandler: false,
DisablePathCorrection: false,
@@ -60,11 +60,11 @@ func main() {
// Prefix: "With", code editors will help you navigate through all
// configuration options without even a glitch to the documentation.
- app.Run(iris.Addr(":8080"), iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
+ app.Listen(":8080", iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
// or before run:
// app.Configure(iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
- // app.Run(iris.Addr(":8080"))
+ // app.Listen(":8080")
}
```
@@ -99,7 +99,7 @@ func main() {
// [...]
// Good when you have two configurations, one for development and a different one for production use.
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.TOML("./configs/iris.tml")))
+ app.Listen(":8080", iris.WithConfiguration(iris.TOML("./configs/iris.tml")))
}
```
@@ -129,7 +129,7 @@ func main() {
})
// [...]
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
+ app.Listen(":8080", iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
}
```
@@ -141,7 +141,7 @@ func main() {
// from the main application's `Run` function.
//
// Usage:
-// err := app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+// err := app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
// will return `nil` if the server's error was `http/iris#ErrServerClosed`.
//
// See `Configuration#IgnoreServerErrors []string` too.
@@ -278,6 +278,6 @@ func main() {
app := iris.New()
app.Configure(counter.Configurator)
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
```
\ No newline at end of file
diff --git a/_examples/configuration/from-configuration-structure/main.go b/_examples/configuration/from-configuration-structure/main.go
index 540c0e7d..6e0d0a3a 100644
--- a/_examples/configuration/from-configuration-structure/main.go
+++ b/_examples/configuration/from-configuration-structure/main.go
@@ -12,7 +12,7 @@ func main() {
// [...]
// Good when you want to modify the whole configuration.
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.Configuration{ // default configuration:
+ app.Listen(":8080", iris.WithConfiguration(iris.Configuration{ // default configuration:
DisableStartupLog: false,
DisableInterruptHandler: false,
DisablePathCorrection: false,
diff --git a/_examples/configuration/from-toml-file/main.go b/_examples/configuration/from-toml-file/main.go
index fe824489..b0c02935 100644
--- a/_examples/configuration/from-toml-file/main.go
+++ b/_examples/configuration/from-toml-file/main.go
@@ -13,9 +13,9 @@ func main() {
// [...]
// Good when you have two configurations, one for development and a different one for production use.
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.TOML("./configs/iris.tml")))
+ app.Listen(":8080", iris.WithConfiguration(iris.TOML("./configs/iris.tml")))
// or before run:
// app.Configure(iris.WithConfiguration(iris.TOML("./configs/iris.tml")))
- // app.Run(iris.Addr(":8080"))
+ // app.Listen(":8080")
}
diff --git a/_examples/configuration/from-yaml-file/main.go b/_examples/configuration/from-yaml-file/main.go
index 3092ed2d..452bf2c7 100644
--- a/_examples/configuration/from-yaml-file/main.go
+++ b/_examples/configuration/from-yaml-file/main.go
@@ -14,9 +14,9 @@ func main() {
// Good when you have two configurations, one for development and a different one for production use.
// If iris.YAML's input string argument is "~" then it loads the configuration from the home directory
// and can be shared between many iris instances.
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
+ app.Listen(":8080", iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
// or before run:
// app.Configure(iris.WithConfiguration(iris.YAML("./configs/iris.yml")))
- // app.Run(iris.Addr(":8080"))
+ // app.Listen(":8080")
}
diff --git a/_examples/configuration/from-yaml-file/shared-configuration/main.go b/_examples/configuration/from-yaml-file/shared-configuration/main.go
index 1b56e5b4..483cd7a5 100644
--- a/_examples/configuration/from-yaml-file/shared-configuration/main.go
+++ b/_examples/configuration/from-yaml-file/shared-configuration/main.go
@@ -14,8 +14,8 @@ func main() {
// Good when you share configuration between multiple iris instances.
// This configuration file lives in your $HOME/iris.yml for unix hosts
// or %HOMEDRIVE%+%HOMEPATH%/iris.yml for windows hosts, and you can modify it.
- app.Run(iris.Addr(":8080"), iris.WithGlobalConfiguration)
+ app.Listen(":8080", iris.WithGlobalConfiguration)
// or before run:
// app.Configure(iris.WithGlobalConfiguration)
- // app.Run(iris.Addr(":8080"))
+ // app.Listen(":8080")
}
diff --git a/_examples/configuration/functional/main.go b/_examples/configuration/functional/main.go
index 674b2330..5eb82c99 100644
--- a/_examples/configuration/functional/main.go
+++ b/_examples/configuration/functional/main.go
@@ -15,9 +15,9 @@ func main() {
// Prefix: "With", code editors will help you navigate through all
// configuration options without even a glitch to the documentation.
- app.Run(iris.Addr(":8080"), iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
+ app.Listen(":8080", iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
// or before run:
// app.Configure(iris.WithoutStartupLog, iris.WithCharset("UTF-8"))
- // app.Run(iris.Addr(":8080"))
+ // app.Listen(":8080")
}
diff --git a/_examples/convert-handlers/negroni-like/main.go b/_examples/convert-handlers/negroni-like/main.go
index b1650605..ff67100b 100644
--- a/_examples/convert-handlers/negroni-like/main.go
+++ b/_examples/convert-handlers/negroni-like/main.go
@@ -26,7 +26,7 @@ func main() {
// http://localhost:8080
// http://localhost:8080/ok
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func negronilikeTestMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
diff --git a/_examples/convert-handlers/nethttp/main.go b/_examples/convert-handlers/nethttp/main.go
index fee83c8f..d56ccd8f 100644
--- a/_examples/convert-handlers/nethttp/main.go
+++ b/_examples/convert-handlers/nethttp/main.go
@@ -23,7 +23,7 @@ func main() {
// http://localhost:8080
// http://localhost:8080/ok
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func nativeTestMiddleware(w http.ResponseWriter, r *http.Request) {
diff --git a/_examples/convert-handlers/real-usecase-raven/wrapping-the-router/main.go b/_examples/convert-handlers/real-usecase-raven/wrapping-the-router/main.go
index 288dc8f7..8abc1a53 100644
--- a/_examples/convert-handlers/real-usecase-raven/wrapping-the-router/main.go
+++ b/_examples/convert-handlers/real-usecase-raven/wrapping-the-router/main.go
@@ -41,5 +41,5 @@ func main() {
irisRouter(w, r)
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/convert-handlers/real-usecase-raven/writing-middleware/main.go b/_examples/convert-handlers/real-usecase-raven/writing-middleware/main.go
index e40f63b9..82ef598b 100644
--- a/_examples/convert-handlers/real-usecase-raven/writing-middleware/main.go
+++ b/_examples/convert-handlers/real-usecase-raven/writing-middleware/main.go
@@ -53,5 +53,5 @@ func main() {
ctx.Writef("Hi")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/cookies/basic/main.go b/_examples/cookies/basic/main.go
index 4bf5796c..f9b789e3 100644
--- a/_examples/cookies/basic/main.go
+++ b/_examples/cookies/basic/main.go
@@ -60,5 +60,5 @@ func main() {
// GET: http://localhost:8080/cookies/my_name/my_value
// GET: http://localhost:8080/cookies/my_name
// DELETE: http://localhost:8080/cookies/my_name
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/cookies/securecookie/main.go b/_examples/cookies/securecookie/main.go
index a355bdb2..40ee7052 100644
--- a/_examples/cookies/securecookie/main.go
+++ b/_examples/cookies/securecookie/main.go
@@ -55,5 +55,5 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/desktop-app/blink/main.go b/_examples/desktop-app/blink/main.go
index 45972879..a771727f 100644
--- a/_examples/desktop-app/blink/main.go
+++ b/_examples/desktop-app/blink/main.go
@@ -23,7 +23,7 @@ func runServer() {
app.Get("/", func(ctx iris.Context) {
ctx.HTML("
Hello Desktop
")
})
- app.Run(iris.Addr(addr))
+ app.Listen(addr)
}
func showAndWaitWindow() {
diff --git a/_examples/desktop-app/lorca/main.go b/_examples/desktop-app/lorca/main.go
index aa191dd5..eb5fe18f 100644
--- a/_examples/desktop-app/lorca/main.go
+++ b/_examples/desktop-app/lorca/main.go
@@ -21,7 +21,7 @@ func runServer() {
app.Get("/", func(ctx iris.Context) {
ctx.HTML("My AppHello Desktop
")
})
- app.Run(iris.Addr(addr))
+ app.Listen(addr)
}
func showAndWaitWindow() {
diff --git a/_examples/desktop-app/webview/main.go b/_examples/desktop-app/webview/main.go
index 3c211139..6e2bb34b 100644
--- a/_examples/desktop-app/webview/main.go
+++ b/_examples/desktop-app/webview/main.go
@@ -30,7 +30,7 @@ func runServer() {
app.Get("/", func(ctx iris.Context) {
ctx.HTML(" Hello Desktop
")
})
- app.Run(iris.Addr(addr))
+ app.Listen(addr)
}
func showAndWaitWindow() {
diff --git a/_examples/docker/main.go b/_examples/docker/main.go
index 521f1126..ae433515 100644
--- a/_examples/docker/main.go
+++ b/_examples/docker/main.go
@@ -22,5 +22,5 @@ func main() {
ctx.Writef("id: %d", ctx.Params().GetUintDefault("id", 0))
})
- app.Run(iris.Addr(*addr))
+ app.Listen(*addr)
}
diff --git a/_examples/experimental-handlers/casbin/middleware/main.go b/_examples/experimental-handlers/casbin/middleware/main.go
index 5d26e920..09b41dc0 100644
--- a/_examples/experimental-handlers/casbin/middleware/main.go
+++ b/_examples/experimental-handlers/casbin/middleware/main.go
@@ -35,7 +35,7 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func hi(ctx iris.Context) {
diff --git a/_examples/experimental-handlers/casbin/wrapper/main.go b/_examples/experimental-handlers/casbin/wrapper/main.go
index dffac88d..dbc851a4 100644
--- a/_examples/experimental-handlers/casbin/wrapper/main.go
+++ b/_examples/experimental-handlers/casbin/wrapper/main.go
@@ -35,7 +35,7 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func hi(ctx iris.Context) {
diff --git a/_examples/experimental-handlers/cloudwatch/simple/main.go b/_examples/experimental-handlers/cloudwatch/simple/main.go
index 4cc71f26..134db6c0 100644
--- a/_examples/experimental-handlers/cloudwatch/simple/main.go
+++ b/_examples/experimental-handlers/cloudwatch/simple/main.go
@@ -46,5 +46,5 @@ func main() {
// http://localhost:8080
// should give: NoCredentialProviders
// which is correct, you have to authorize your aws, we asumme that you know how to.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/cors/simple/client/main.go b/_examples/experimental-handlers/cors/simple/client/main.go
index 03f7db49..bf551f30 100644
--- a/_examples/experimental-handlers/cors/simple/client/main.go
+++ b/_examples/experimental-handlers/cors/simple/client/main.go
@@ -34,5 +34,5 @@ func main() {
// Start and navigate to http://localhost:8080
// and go to the previous terminal of your running cors/simple/main.go server
// and see the logs.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/cors/simple/main.go b/_examples/experimental-handlers/cors/simple/main.go
index 90b2b37e..61eba676 100644
--- a/_examples/experimental-handlers/cors/simple/main.go
+++ b/_examples/experimental-handlers/cors/simple/main.go
@@ -46,9 +46,8 @@ func main() {
// iris.WithoutPathCorrectionRedirection | iris#Configuration.DisablePathCorrectionRedirection:
// CORS needs the allow origin headers in the redirect response as well, we have a solution for this:
- // If you use iris >= v11.0.4 then add the `app.Run(..., iris.WithoutPathCorrectionRedirection)`
- // on the server side if you wish
+ // Add the iris.WithoutPathCorrectionRedirection option
// to directly fire the handler instead of redirection (which is the default behavior)
// on request paths like "/v1/mailer/" when "/v1/mailer" route handler is registered.
- app.Run(iris.Addr(":80"), iris.WithoutPathCorrectionRedirection)
+ app.Listen(":80", iris.WithoutPathCorrectionRedirection)
}
diff --git a/_examples/experimental-handlers/csrf/main.go b/_examples/experimental-handlers/csrf/main.go
index b1bff1aa..2a08814c 100644
--- a/_examples/experimental-handlers/csrf/main.go
+++ b/_examples/experimental-handlers/csrf/main.go
@@ -35,7 +35,7 @@ func main() {
// GET: http://localhost:8080/user/signup
// POST: http://localhost:8080/user/signup
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func getSignupForm(ctx iris.Context) {
diff --git a/_examples/experimental-handlers/jwt/main.go b/_examples/experimental-handlers/jwt/main.go
index 878ffc86..9fe4cb91 100644
--- a/_examples/experimental-handlers/jwt/main.go
+++ b/_examples/experimental-handlers/jwt/main.go
@@ -52,5 +52,5 @@ func main() {
app.Get("/", getTokenHandler)
app.Get("/secured", j.Serve, myAuthenticatedHandler)
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/newrelic/simple/main.go b/_examples/experimental-handlers/newrelic/simple/main.go
index 28d3e1e2..dbd0d558 100644
--- a/_examples/experimental-handlers/newrelic/simple/main.go
+++ b/_examples/experimental-handlers/newrelic/simple/main.go
@@ -20,5 +20,5 @@ func main() {
ctx.Writef("success!\n")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/prometheus/simple/main.go b/_examples/experimental-handlers/prometheus/simple/main.go
index 2cc53ab5..6c2011d2 100644
--- a/_examples/experimental-handlers/prometheus/simple/main.go
+++ b/_examples/experimental-handlers/prometheus/simple/main.go
@@ -35,5 +35,5 @@ func main() {
// http://localhost:8080/
// http://localhost:8080/anotfound
// http://localhost:8080/metrics
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/secure/simple/main.go b/_examples/experimental-handlers/secure/simple/main.go
index 64359dde..be86a876 100644
--- a/_examples/experimental-handlers/secure/simple/main.go
+++ b/_examples/experimental-handlers/secure/simple/main.go
@@ -34,5 +34,5 @@ func main() {
ctx.Writef("Hello from /home")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/experimental-handlers/tollboothic/limit-handler/main.go b/_examples/experimental-handlers/tollboothic/limit-handler/main.go
index 2e878136..db52dcad 100644
--- a/_examples/experimental-handlers/tollboothic/limit-handler/main.go
+++ b/_examples/experimental-handlers/tollboothic/limit-handler/main.go
@@ -25,7 +25,7 @@ func main() {
ctx.HTML("Hello, world!")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
// Read more at: https://github.com/didip/tollbooth
diff --git a/_examples/file-server/basic/main.go b/_examples/file-server/basic/main.go
index e15ceec6..e261239e 100644
--- a/_examples/file-server/basic/main.go
+++ b/_examples/file-server/basic/main.go
@@ -48,5 +48,5 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/embedding-files-into-app/main.go b/_examples/file-server/embedding-files-into-app/main.go
index 143dcc69..1b239cf8 100644
--- a/_examples/file-server/embedding-files-into-app/main.go
+++ b/_examples/file-server/embedding-files-into-app/main.go
@@ -32,5 +32,5 @@ func main() {
// http://localhost:8080/static/css/bootstrap.min.css
// http://localhost:8080/static/js/jquery-2.1.1.js
// http://localhost:8080/static/favicon.ico
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/embedding-gziped-files-into-app/main.go b/_examples/file-server/embedding-gziped-files-into-app/main.go
index 8e2041e0..f6501fca 100644
--- a/_examples/file-server/embedding-gziped-files-into-app/main.go
+++ b/_examples/file-server/embedding-gziped-files-into-app/main.go
@@ -32,5 +32,5 @@ func main() {
// http://localhost:8080/static/css/bootstrap.min.css
// http://localhost:8080/static/js/jquery-2.1.1.js
// http://localhost:8080/static/favicon.ico
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/favicon/main.go b/_examples/file-server/favicon/main.go
index 9f84649c..f10f6088 100644
--- a/_examples/file-server/favicon/main.go
+++ b/_examples/file-server/favicon/main.go
@@ -20,5 +20,5 @@ func main() {
so iris serves your favicon in that path too (you can change it).`)
}) // if favicon doesn't show to you, try to clear your browser's cache.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/send-files/main.go b/_examples/file-server/send-files/main.go
index 709750f7..bc03b0a1 100644
--- a/_examples/file-server/send-files/main.go
+++ b/_examples/file-server/send-files/main.go
@@ -12,5 +12,5 @@ func main() {
ctx.SendFile(file, "c.zip")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/single-page-application/basic/main.go b/_examples/file-server/single-page-application/basic/main.go
index 4d86e164..89a19a13 100644
--- a/_examples/file-server/single-page-application/basic/main.go
+++ b/_examples/file-server/single-page-application/basic/main.go
@@ -32,5 +32,5 @@ func main() {
// http://localhost:8080/index.html
// http://localhost:8080/app.js
// http://localhost:8080/css/main.css
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go b/_examples/file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go
index 61070633..3fd55e6f 100644
--- a/_examples/file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go
+++ b/_examples/file-server/single-page-application/embedded-single-page-application-with-other-routes/main.go
@@ -61,5 +61,5 @@ func main() {
// http://localhost:8080/.well-known/metrics
//
// Remember: we could use the root wildcard `app.Get("/{param:path}")` and serve the files manually as well.
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/single-page-application/embedded-single-page-application/main.go b/_examples/file-server/single-page-application/embedded-single-page-application/main.go
index a1d8e608..7091dca5 100644
--- a/_examples/file-server/single-page-application/embedded-single-page-application/main.go
+++ b/_examples/file-server/single-page-application/embedded-single-page-application/main.go
@@ -37,5 +37,5 @@ func main() {
// http://localhost:8080/app.js
// http://localhost:8080/css/main.css
// http://localhost:8080/app2
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/file-server/subdomain/main.go b/_examples/file-server/subdomain/main.go
index a064d5e2..94ba8aa5 100644
--- a/_examples/file-server/subdomain/main.go
+++ b/_examples/file-server/subdomain/main.go
@@ -25,5 +25,5 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(addr))
+ app.Listen(addr)
}
diff --git a/_examples/hello-world/main.go b/_examples/hello-world/main.go
index eebc9ff2..3b86e0d7 100644
--- a/_examples/hello-world/main.go
+++ b/_examples/hello-world/main.go
@@ -38,5 +38,5 @@ func main() {
// http://localhost:8080
// http://localhost:8080/ping
// http://localhost:8080/hello
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
diff --git a/_examples/hero/basic/main.go b/_examples/hero/basic/main.go
index 03707535..88214b14 100644
--- a/_examples/hero/basic/main.go
+++ b/_examples/hero/basic/main.go
@@ -33,7 +33,7 @@ func main() {
// http://localhost:8080/your_name
// http://localhost:8080/service/your_name
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
func hello(to string) string {
diff --git a/_examples/hero/smart-contract/main.go b/_examples/hero/smart-contract/main.go
index 1ee5dc50..fd635309 100644
--- a/_examples/hero/smart-contract/main.go
+++ b/_examples/hero/smart-contract/main.go
@@ -42,7 +42,7 @@ func main() {
// http://localhost:8080/users
// http://localhost:8080/users/William%20Woe
// http://localhost:8080/users/William%20Woe/age
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
/*
diff --git a/_examples/http-listening/README.md b/_examples/http-listening/README.md
index 9d078d2f..ffedd47f 100644
--- a/_examples/http-listening/README.md
+++ b/_examples/http-listening/README.md
@@ -11,7 +11,7 @@ we use the `iris.Addr` which is an `iris.Runner` type
```go
// Listening on tcp with network address 0.0.0.0:8080
-app.Run(iris.Addr(":8080"))
+app.Listen(":8080")
```
Sometimes you have created a standard net/http server somewhere else in your app and want to use that to serve the Iris web app
@@ -166,7 +166,7 @@ app.ConfigureHost(func(h *iris.Supervisor) {
println("server terminated")
})
})
-app.Run(iris.Addr(":8080"))
+app.Listen(":8080")
```
Access to all hosts that serve your application can be provided by
@@ -201,7 +201,7 @@ app := iris.New()
app.Get("/", indexHandler)
// run in different goroutine in order to not block the main "goroutine".
-go app.Run(iris.Addr(":8080"))
+go app.Listen(":8080")
// start a second server which is listening on tcp 0.0.0.0:9090,
// without "go" keyword because we want to block at the last server-run.
app.NewHost(&http.Server{Addr:":9090"}).ListenAndServe()
@@ -246,6 +246,6 @@ func main() {
ctx.HTML(" hi, I just exist in order to see if the server is closed
")
})
- app.Run(iris.Addr(":8080"), iris.WithoutInterruptHandler)
+ app.Listen(":8080", iris.WithoutInterruptHandler)
}
```
diff --git a/_examples/http-listening/custom-httpserver/easy-way/main.go b/_examples/http-listening/custom-httpserver/easy-way/main.go
index a4e6dee7..b6f71e8a 100644
--- a/_examples/http-listening/custom-httpserver/easy-way/main.go
+++ b/_examples/http-listening/custom-httpserver/easy-way/main.go
@@ -22,7 +22,7 @@ func main() {
// http://localhost:8080/
// http://localhost:8080/mypath
- app.Run(iris.Server(srv)) // same as app.Run(iris.Addr(":8080"))
+ app.Run(iris.Server(srv)) // same as app.Listen(":8080")
// More:
// see "multi" if you need to use more than one server at the same app.
diff --git a/_examples/http-listening/custom-httpserver/multi/main.go b/_examples/http-listening/custom-httpserver/multi/main.go
index 98802b74..083e8e6c 100644
--- a/_examples/http-listening/custom-httpserver/multi/main.go
+++ b/_examples/http-listening/custom-httpserver/multi/main.go
@@ -43,5 +43,5 @@ func main() {
// you can just make a new http.Server instead.
// http://localhost:8080/
// http://localhost:8080/mypath
- app.Run(iris.Addr(":8080")) // Block here.
+ app.Listen(":8080") // Block here.
}
diff --git a/_examples/http-listening/custom-httpserver/std-way/main.go b/_examples/http-listening/custom-httpserver/std-way/main.go
index 37f4f67d..b4817d2d 100644
--- a/_examples/http-listening/custom-httpserver/std-way/main.go
+++ b/_examples/http-listening/custom-httpserver/std-way/main.go
@@ -25,7 +25,7 @@ func main() {
// http://localhost:8080/
// http://localhost:8080/mypath
println("Start a server listening on http://localhost:8080")
- srv.ListenAndServe() // same as app.Run(iris.Addr(":8080"))
+ srv.ListenAndServe() // same as app.Listen(":8080")
// Notes:
// Banner is not shown at all. Same for the Interrupt Handler, even if app's configuration allows them.
diff --git a/_examples/http-listening/graceful-shutdown/custom-notifier/main.go b/_examples/http-listening/graceful-shutdown/custom-notifier/main.go
index 998aaa49..abde2644 100644
--- a/_examples/http-listening/graceful-shutdown/custom-notifier/main.go
+++ b/_examples/http-listening/graceful-shutdown/custom-notifier/main.go
@@ -42,5 +42,5 @@ func main() {
// Start the server and disable the default interrupt handler in order to
// handle it clear and simple by our own, without any issues.
- app.Run(iris.Addr(":8080"), iris.WithoutInterruptHandler)
+ app.Listen(":8080", iris.WithoutInterruptHandler)
}
diff --git a/_examples/http-listening/graceful-shutdown/default-notifier/main.go b/_examples/http-listening/graceful-shutdown/default-notifier/main.go
index 58369cbb..c692af57 100644
--- a/_examples/http-listening/graceful-shutdown/default-notifier/main.go
+++ b/_examples/http-listening/graceful-shutdown/default-notifier/main.go
@@ -30,5 +30,5 @@ func main() {
})
// http://localhost:8080
- app.Run(iris.Addr(":8080"), iris.WithoutInterruptHandler)
+ app.Listen(":8080", iris.WithoutInterruptHandler)
}
diff --git a/_examples/http-listening/iris-configurator-and-host-configurator/main.go b/_examples/http-listening/iris-configurator-and-host-configurator/main.go
index 492bc146..ddece844 100644
--- a/_examples/http-listening/iris-configurator-and-host-configurator/main.go
+++ b/_examples/http-listening/iris-configurator-and-host-configurator/main.go
@@ -20,7 +20,7 @@ func main() {
ctx.HTML("Hello
\n")
})
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
/* There are more easy ways to notify for global shutdown using the `iris.RegisterOnInterrupt` for default signal interrupt events.
You can even go it even further by looking at the: "graceful-shutdown" example.
diff --git a/_examples/http-listening/listen-addr-public/main.go b/_examples/http-listening/listen-addr-public/main.go
index 7446f46a..f1423570 100644
--- a/_examples/http-listening/listen-addr-public/main.go
+++ b/_examples/http-listening/listen-addr-public/main.go
@@ -14,10 +14,10 @@ func main() {
ctx.Application().ConfigurationReadOnly().GetVHost())
})
- app.Run(iris.Addr(":8080"), iris.WithTunneling)
+ app.Listen(":8080", iris.WithTunneling)
/* The full configuration can be set as:
- app.Run(iris.Addr(":8080"), iris.WithConfiguration(
+ app.Listen(":8080", iris.WithConfiguration(
iris.Configuration{
Tunneling: iris.TunnelingConfiguration{
AuthToken: "my-ngrok-auth-client-token",
diff --git a/_examples/http-listening/listen-addr/main.go b/_examples/http-listening/listen-addr/main.go
index 9c7d3207..551fded8 100644
--- a/_examples/http-listening/listen-addr/main.go
+++ b/_examples/http-listening/listen-addr/main.go
@@ -12,5 +12,6 @@ func main() {
})
// http://localhost:8080
- app.Run(iris.Addr(":8080"))
+ // Identical to: app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http-listening/listen-addr/omit-server-errors/main.go b/_examples/http-listening/listen-addr/omit-server-errors/main.go
index 3a73b585..339a5b57 100644
--- a/_examples/http-listening/listen-addr/omit-server-errors/main.go
+++ b/_examples/http-listening/listen-addr/omit-server-errors/main.go
@@ -11,12 +11,12 @@ func main() {
ctx.HTML("Hello World!
")
})
- err := app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ err := app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
if err != nil {
// do something
}
// same as:
- // err := app.Run(iris.Addr(":8080"))
+ // err := app.Listen(":8080")
// if err != nil && (err != iris.ErrServerClosed || err.Error() != iris.ErrServerClosed.Error()) {
// [...]
// }
diff --git a/_examples/http-listening/listen-addr/omit-server-errors/main_test.go b/_examples/http-listening/listen-addr/omit-server-errors/main_test.go
index 9d4a23d8..e26aaf90 100644
--- a/_examples/http-listening/listen-addr/omit-server-errors/main_test.go
+++ b/_examples/http-listening/listen-addr/omit-server-errors/main_test.go
@@ -34,7 +34,7 @@ func TestListenAddr(t *testing.T) {
app.Shutdown(ctx)
}()
- err := app.Run(iris.Addr(":9829"))
+ err := app.Listen(":9829")
// in this case the error should be logged and return as well.
if err != iris.ErrServerClosed {
t.Fatalf("expecting err to be `iris.ErrServerClosed` but got: %v", err)
@@ -63,7 +63,7 @@ func TestListenAddrWithoutServerErr(t *testing.T) {
// we disable the ErrServerClosed, so the error should be nil when server is closed by `app.Shutdown`.
// so in this case the iris/http.ErrServerClosed should be NOT logged and NOT return.
- err := app.Run(iris.Addr(":9827"), iris.WithoutServerError(iris.ErrServerClosed))
+ err := app.Listen(":9827", iris.WithoutServerError(iris.ErrServerClosed))
if err != nil {
t.Fatalf("expecting err to be nil but got: %v", err)
}
diff --git a/_examples/http_request/extract-referer/main.go b/_examples/http_request/extract-referer/main.go
index 9b197224..33615d05 100644
--- a/_examples/http_request/extract-referer/main.go
+++ b/_examples/http_request/extract-referer/main.go
@@ -24,5 +24,5 @@ func main() {
// http://localhost:8080?referer=https://twitter.com/Xinterio/status/1023566830974251008
// http://localhost:8080?referer=https://www.google.com/search?q=Top+6+golang+web+frameworks&oq=Top+6+golang+web+frameworks
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
diff --git a/_examples/http_request/read-custom-per-type/main.go b/_examples/http_request/read-custom-per-type/main.go
index f445cc7d..9a425339 100644
--- a/_examples/http_request/read-custom-per-type/main.go
+++ b/_examples/http_request/read-custom-per-type/main.go
@@ -19,7 +19,7 @@ func main() {
//
// The response should be:
// Received: main.config{Addr:"localhost:8080", ServerName:"Iris"}
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
}
func newApp() *iris.Application {
diff --git a/_examples/http_request/read-custom-via-unmarshaler/main.go b/_examples/http_request/read-custom-via-unmarshaler/main.go
index e83edade..c71f7c69 100644
--- a/_examples/http_request/read-custom-via-unmarshaler/main.go
+++ b/_examples/http_request/read-custom-via-unmarshaler/main.go
@@ -19,7 +19,7 @@ func main() {
//
// The response should be:
// Received: main.config{Addr:"localhost:8080", ServerName:"Iris"}
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
}
func newApp() *iris.Application {
diff --git a/_examples/http_request/read-form/main.go b/_examples/http_request/read-form/main.go
index 7c79b5dc..441bb8ab 100644
--- a/_examples/http_request/read-form/main.go
+++ b/_examples/http_request/read-form/main.go
@@ -40,5 +40,5 @@ func main() {
ctx.Writef("Username: %s", username)
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_request/read-json-struct-validation/main.go b/_examples/http_request/read-json-struct-validation/main.go
index 3f608007..95ff6f29 100644
--- a/_examples/http_request/read-json-struct-validation/main.go
+++ b/_examples/http_request/read-json-struct-validation/main.go
@@ -118,7 +118,7 @@ func main() {
// This request will fail due to the empty `User.FirstName` (fname in json)
// and `User.LastName` (lname in json).
// Check your iris' application terminal output.
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
// UserStructLevelValidation contains custom struct level validations that don't always
diff --git a/_examples/http_request/read-json/main.go b/_examples/http_request/read-json/main.go
index 892dac22..1d06d968 100644
--- a/_examples/http_request/read-json/main.go
+++ b/_examples/http_request/read-json/main.go
@@ -60,5 +60,5 @@ func main() {
//
// The response should be:
// Received: main.Company{Name:"iris-Go", City:"New York", Other:"Something here"}
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
}
diff --git a/_examples/http_request/read-many/main.go b/_examples/http_request/read-many/main.go
index 007902a0..b529fb0f 100644
--- a/_examples/http_request/read-many/main.go
+++ b/_examples/http_request/read-many/main.go
@@ -30,7 +30,7 @@ Check the terminal window for any queries logs.`)
// and ctx.GetBody methods the default golang and net/http behavior
// is to consume the readen data - they are not available on any next handlers in the chain -
// to change that behavior just pass the `WithoutBodyConsumptionOnUnmarshal` option.
- app.Run(iris.Addr(":8080"), iris.WithoutBodyConsumptionOnUnmarshal)
+ app.Listen(":8080", iris.WithoutBodyConsumptionOnUnmarshal)
}
func logAllBody(ctx iris.Context) {
diff --git a/_examples/http_request/read-query/main.go b/_examples/http_request/read-query/main.go
index f0576038..86386874 100644
--- a/_examples/http_request/read-query/main.go
+++ b/_examples/http_request/read-query/main.go
@@ -25,5 +25,5 @@ func main() {
})
// http://localhost:8080?name=iris&age=3
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_request/read-xml/main.go b/_examples/http_request/read-xml/main.go
index 9bac9e50..e7234987 100644
--- a/_examples/http_request/read-xml/main.go
+++ b/_examples/http_request/read-xml/main.go
@@ -20,7 +20,7 @@ func main() {
//
// The response should be:
// Received: main.person{XMLName:xml.Name{Space:"", Local:"person"}, Name:"Winston Churchill", Age:90, Description:"Description of this person, the body of this inner element."}
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed), iris.WithOptimizations)
}
func newApp() *iris.Application {
diff --git a/_examples/http_request/read-yaml/main.go b/_examples/http_request/read-yaml/main.go
index 5d14ac13..27b9e965 100644
--- a/_examples/http_request/read-yaml/main.go
+++ b/_examples/http_request/read-yaml/main.go
@@ -32,5 +32,5 @@ func handler(ctx iris.Context) {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_request/request-logger/main.go b/_examples/http_request/request-logger/main.go
index 77fa4f3e..73d31503 100644
--- a/_examples/http_request/request-logger/main.go
+++ b/_examples/http_request/request-logger/main.go
@@ -61,5 +61,5 @@ func main() {
// http://localhost:8080/2
// http://lcoalhost:8080/notfoundhere
// see the output on the console.
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
diff --git a/_examples/http_request/request-logger/request-logger-file-json/main.go b/_examples/http_request/request-logger/request-logger-file-json/main.go
index 6cec4a25..b905a3d1 100644
--- a/_examples/http_request/request-logger/request-logger-file-json/main.go
+++ b/_examples/http_request/request-logger/request-logger-file-json/main.go
@@ -82,7 +82,7 @@ func main() {
// http://localhost:8080/1
// http://localhost:8080/2
// http://lcoalhost:8080/notfoundhere
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
var excludeExtensions = [...]string{
diff --git a/_examples/http_request/request-logger/request-logger-file/main.go b/_examples/http_request/request-logger/request-logger-file/main.go
index a0de8f0a..a6a6ec9b 100644
--- a/_examples/http_request/request-logger/request-logger-file/main.go
+++ b/_examples/http_request/request-logger/request-logger-file/main.go
@@ -35,7 +35,7 @@ func main() {
// http://localhost:8080/1
// http://localhost:8080/2
// http://lcoalhost:8080/notfoundhere
- app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
+ app.Listen(":8080", iris.WithoutServerError(iris.ErrServerClosed))
}
// get a filename based on the date, file logs works that way the most times
diff --git a/_examples/http_request/upload-file/main.go b/_examples/http_request/upload-file/main.go
index 9deb55b7..0d34dc16 100644
--- a/_examples/http_request/upload-file/main.go
+++ b/_examples/http_request/upload-file/main.go
@@ -124,5 +124,5 @@ func main() {
})
// start the server at http://localhost:8080 with post limit at 5 MB.
- app.Run(iris.Addr(":8080") /* 0.*/, iris.WithPostMaxMemory(maxSize))
+ app.Listen(":8080" /* 0.*/, iris.WithPostMaxMemory(maxSize))
}
diff --git a/_examples/http_request/upload-files/main.go b/_examples/http_request/upload-files/main.go
index 9a45164f..e18dff28 100644
--- a/_examples/http_request/upload-files/main.go
+++ b/_examples/http_request/upload-files/main.go
@@ -72,7 +72,7 @@ func main() {
})
// start the server at http://localhost:8080 with post limit at 32 MB.
- app.Run(iris.Addr(":8080"), iris.WithPostMaxMemory(32<<20))
+ app.Listen(":8080", iris.WithPostMaxMemory(32<<20))
}
func saveUploadedFile(fh *multipart.FileHeader, destDirectory string) (int64, error) {
diff --git a/_examples/http_responsewriter/content-negotiation/main.go b/_examples/http_responsewriter/content-negotiation/main.go
index 640717c3..f4971414 100644
--- a/_examples/http_responsewriter/content-negotiation/main.go
+++ b/_examples/http_responsewriter/content-negotiation/main.go
@@ -110,5 +110,5 @@ func newApp() *iris.Application {
func main() {
app := newApp()
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_responsewriter/herotemplate/app.go b/_examples/http_responsewriter/herotemplate/app.go
index 015472ff..429e4d6a 100644
--- a/_examples/http_responsewriter/herotemplate/app.go
+++ b/_examples/http_responsewriter/herotemplate/app.go
@@ -50,5 +50,5 @@ func main() {
}
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_responsewriter/quicktemplate/main.go b/_examples/http_responsewriter/quicktemplate/main.go
index a7c993a9..607f35d2 100644
--- a/_examples/http_responsewriter/quicktemplate/main.go
+++ b/_examples/http_responsewriter/quicktemplate/main.go
@@ -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))
}
diff --git a/_examples/http_responsewriter/sse-third-party/main.go b/_examples/http_responsewriter/sse-third-party/main.go
index dc8bd7af..d0e55941 100644
--- a/_examples/http_responsewriter/sse-third-party/main.go
+++ b/_examples/http_responsewriter/sse-third-party/main.go
@@ -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 */
diff --git a/_examples/http_responsewriter/sse/main.go b/_examples/http_responsewriter/sse/main.go
index 042a055c..1abd48c2 100644
--- a/_examples/http_responsewriter/sse/main.go
+++ b/_examples/http_responsewriter/sse/main.go
@@ -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))
}
diff --git a/_examples/http_responsewriter/stream-writer/main.go b/_examples/http_responsewriter/stream-writer/main.go
index c7ad0836..c7a6c558 100644
--- a/_examples/http_responsewriter/stream-writer/main.go
+++ b/_examples/http_responsewriter/stream-writer/main.go
@@ -50,5 +50,5 @@ func main() {
}
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_responsewriter/transactions/main.go b/_examples/http_responsewriter/transactions/main.go
index 63757448..5231b026 100644
--- a/_examples/http_responsewriter/transactions/main.go
+++ b/_examples/http_responsewriter/transactions/main.go
@@ -50,5 +50,5 @@ func main() {
"not been shown. But it has a transient scope(default) so, it is visible as expected!")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_responsewriter/write-gzip/main.go b/_examples/http_responsewriter/write-gzip/main.go
index b06e37f9..f1d6369d 100644
--- a/_examples/http_responsewriter/write-gzip/main.go
+++ b/_examples/http_responsewriter/write-gzip/main.go
@@ -17,5 +17,5 @@ func main() {
ctx.GzipResponseWriter().WriteString("Hello World!")
})
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/http_responsewriter/write-rest/main.go b/_examples/http_responsewriter/write-rest/main.go
index 1ccfdff9..622acb82 100644
--- a/_examples/http_responsewriter/write-rest/main.go
+++ b/_examples/http_responsewriter/write-rest/main.go
@@ -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)
}
diff --git a/_examples/i18n/main.go b/_examples/i18n/main.go
index d32806a8..fbc1fd8c 100644
--- a/_examples/i18n/main.go
+++ b/_examples/i18n/main.go
@@ -85,5 +85,5 @@ func main() {
// or http://localhost:8080/other?lang=en-US
//
// or use cookies to set the language.
- app.Run(iris.Addr(":8080"), iris.WithSitemap("http://localhost:8080"))
+ app.Listen(":8080", iris.WithSitemap("http://localhost:8080"))
}
diff --git a/_examples/miscellaneous/file-logger/main.go b/_examples/miscellaneous/file-logger/main.go
index 7890a533..2141b70e 100644
--- a/_examples/miscellaneous/file-logger/main.go
+++ b/_examples/miscellaneous/file-logger/main.go
@@ -42,7 +42,7 @@ func main() {
// Navigate to http://localhost:8080/ping
// and open the ./logs{TODAY}.txt file.
- if err := app.Run(iris.Addr(":8080"), iris.WithoutBanner, iris.WithoutServerError(iris.ErrServerClosed)); err != nil {
+ if err := app.Listen(":8080", iris.WithoutBanner, iris.WithoutServerError(iris.ErrServerClosed)); err != nil {
app.Logger().Warn("Shutdown with error: " + err.Error())
}
}
diff --git a/_examples/miscellaneous/pprof/main.go b/_examples/miscellaneous/pprof/main.go
index 9ed17ba2..47705503 100644
--- a/_examples/miscellaneous/pprof/main.go
+++ b/_examples/miscellaneous/pprof/main.go
@@ -17,5 +17,5 @@ func main() {
app.Any("/debug/pprof", p)
app.Any("/debug/pprof/{action:path}", p)
// ___________
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
diff --git a/_examples/miscellaneous/recaptcha/custom_form/main.go b/_examples/miscellaneous/recaptcha/custom_form/main.go
index 621fa28e..395c7c45 100644
--- a/_examples/miscellaneous/recaptcha/custom_form/main.go
+++ b/_examples/miscellaneous/recaptcha/custom_form/main.go
@@ -24,7 +24,7 @@ func main() {
// pass the middleware before the main handler or use the `recaptcha.SiteVerify`.
app.Post("/comment", r, postComment)
- app.Run(iris.Addr(":8080"))
+ app.Listen(":8080")
}
var htmlForm = `