diff --git a/.gitignore b/.gitignore index 667b16e5..842c9846 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ 2M_donation_timeline.cpd performance_tips.txt notes.txt +organisations_using_iris.txt +independent_developers_using_iris.txt diff --git a/middleware/basicauth/_example/main.go b/middleware/basicauth/_example/main.go index c72134ff..99e46352 100644 --- a/middleware/basicauth/_example/main.go +++ b/middleware/basicauth/_example/main.go @@ -10,7 +10,8 @@ import ( func main() { app := iris.New() - app.Adapt(httprouter.New()) // adapt a router first of all + app.Adapt(iris.DevLogger()) // adapt a simple internal logger to print any errors + app.Adapt(httprouter.New()) // adapt a router, you can use gorillamux too authConfig := basicauth.Config{ Users: map[string]string{"myusername": "mypassword", "mySecondusername": "mySecondpassword"}, diff --git a/middleware/i18n/_example/main.go b/middleware/i18n/_example/main.go index 425fc55b..98256043 100644 --- a/middleware/i18n/_example/main.go +++ b/middleware/i18n/_example/main.go @@ -8,7 +8,8 @@ import ( func main() { app := iris.New() - app.Adapt(httprouter.New()) // adapt a router first of all + app.Adapt(iris.DevLogger()) // adapt a simple internal logger to print any errors + app.Adapt(httprouter.New()) // adapt a router, you can use gorillamux too app.Use(i18n.New(i18n.Config{ Default: "en-US", diff --git a/middleware/recover/_example/main.go b/middleware/recover/_example/main.go index 91703f6a..1a97c26b 100644 --- a/middleware/recover/_example/main.go +++ b/middleware/recover/_example/main.go @@ -8,13 +8,16 @@ import ( func main() { app := iris.New() - app.Adapt(httprouter.New()) - - app.Adapt(iris.DevLogger()) // fast way to enable non-fatal messages to be printed to the user + // fast way to enable non-fatal messages to be printed to the user // (yes in iris even recover's errors are not fatal because it's restarting, // ProdMode messages are only for things that Iris cannot continue at all, // these are logged by-default but you can change that behavior too by passing a different LoggerPolicy to the .Adapt) - app.Use(recover.New()) // it's io.Writer is the same as app.Config.LoggerOut + app.Adapt(iris.DevLogger()) + // adapt a router, you can use gorillamux too + app.Adapt(httprouter.New()) + + // use this recover(y) middleware + app.Use(recover.New()) i := 0 // let's simmilate a panic every next request