1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-21 02:45:59 +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

@@ -47,7 +47,7 @@ func main() {
// http://localhost:8080
// http://localhost:8080/about
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
// Notes: ViewData("", myCustomStruct{}) will set this myCustomStruct value as a root binding data,

View File

@@ -53,7 +53,7 @@ func main() {
// http://localhost:8080/nolayout
// http://localhost:8080/my
// http://localhost:8080/my/other
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
// Note for new Gophers:

View File

@@ -20,7 +20,7 @@ func main() {
})
// http://localhost:8080/
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
/*

View File

@@ -26,7 +26,7 @@ func main() {
app.Get("/", hi)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func hi(ctx iris.Context) {

View File

@@ -24,7 +24,7 @@ func main() {
app.Get("/", hi)
// http://localhost:8080
app.Run(iris.Addr(":8080"), iris.WithCharset("UTF-8")) // defaults to that but you can change it.
app.Listen(":8080", iris.WithCharset("UTF-8")) // defaults to that but you can change it.
}
func hi(ctx iris.Context) {

View File

@@ -25,5 +25,5 @@ func main() {
})
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -46,5 +46,5 @@ func main() {
// http://localhost:8080/nolayout
// http://localhost:8080/my
// http://localhost:8080/my/other
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -58,7 +58,7 @@ func main() {
// http://localhost:8080
// http://localhost:8080/redirect/my-page1
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func writePathHandler(ctx iris.Context) {

View File

@@ -63,7 +63,7 @@ func main() {
app.Get("/mypath7/{paramfirst}/{paramsecond}/static/{paramthird}", emptyHandler).Name = "my-page7"
// http://127.0.0.1:8080
app.Run(iris.Addr(host))
app.Listen(host)
}
func emptyHandler(ctx iris.Context) {

View File

@@ -27,5 +27,5 @@ func main() {
})
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}

View File

@@ -141,5 +141,5 @@ func main() {
port = ":" + port
}
app.Run(iris.Addr(port))
app.Listen(port)
}

View File

@@ -30,5 +30,5 @@ func main() {
port = ":" + port
}
app.Run(iris.Addr(port))
app.Listen(port)
}

View File

@@ -58,7 +58,7 @@ func main() {
// http://localhost:8080
// http://localhost:8080/redirect/my-page1
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func writePathHandler(ctx iris.Context) {

View File

@@ -30,7 +30,7 @@ func main() {
ctx.View("index.jet")
})
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
type ViewBuiler struct {

View File

@@ -16,7 +16,7 @@ func main() {
app.Get("/", index)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func index(ctx iris.Context) {

View File

@@ -24,7 +24,7 @@ func main() {
app.Get("/", index)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func index(ctx iris.Context) {

View File

@@ -20,7 +20,7 @@ func main() {
app.Get("/", index)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func index(ctx iris.Context) {

View File

@@ -15,7 +15,7 @@ func main() {
app.Get("/", index)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}
func index(ctx iris.Context) {

View File

@@ -38,5 +38,5 @@ func main() {
app.Logger().Errorf("error from app.View: %v", err)
}
app.Run(iris.Addr(":8080"))
app.Listen(":8080")
}