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:
@@ -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,
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -20,7 +20,7 @@ func main() {
|
||||
})
|
||||
|
||||
// http://localhost:8080/
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -25,5 +25,5 @@ func main() {
|
||||
})
|
||||
|
||||
// http://localhost:8080
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -27,5 +27,5 @@ func main() {
|
||||
})
|
||||
|
||||
// http://localhost:8080
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
@@ -141,5 +141,5 @@ func main() {
|
||||
port = ":" + port
|
||||
}
|
||||
|
||||
app.Run(iris.Addr(port))
|
||||
app.Listen(port)
|
||||
}
|
||||
|
||||
@@ -30,5 +30,5 @@ func main() {
|
||||
port = ":" + port
|
||||
}
|
||||
|
||||
app.Run(iris.Addr(port))
|
||||
app.Listen(port)
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -30,7 +30,7 @@ func main() {
|
||||
ctx.View("index.jet")
|
||||
})
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
type ViewBuiler struct {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -38,5 +38,5 @@ func main() {
|
||||
app.Logger().Errorf("error from app.View: %v", err)
|
||||
}
|
||||
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Listen(":8080")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user