1
0
mirror of https://github.com/kataras/iris.git synced 2026-05-14 18:13:49 +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:
Gerasimos (Makis) Maropoulos
2020-03-05 22:41:27 +02:00
parent b6445c7238
commit 0d26f24eb7
182 changed files with 202 additions and 227 deletions

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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")
}

View File

@@ -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")
}

View File

@@ -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)
}

View File

@@ -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) {

View File

@@ -52,5 +52,5 @@ func main() {
app.Get("/", getTokenHandler)
app.Get("/secured", j.Serve, myAuthenticatedHandler)
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -20,5 +20,5 @@ func main() {
ctx.Writef("success!\n")
})
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -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")
}

View File

@@ -34,5 +34,5 @@ func main() {
ctx.Writef("Hello from /home")
})
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -25,7 +25,7 @@ func main() {
ctx.HTML("<b>Hello, world!</b>")
})
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
// Read more at: https://github.com/didip/tollbooth