mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
Nothing special here. Come on post some good feature requests, I'm starting to get bored!
Former-commit-id: 6afc6ab3a3d2c35bc588dc91c132f1f7a6b24db3
This commit is contained in:
parent
963e4609cf
commit
f26dd69f9c
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -4,3 +4,5 @@
|
||||||
2M_donation_timeline.cpd
|
2M_donation_timeline.cpd
|
||||||
performance_tips.txt
|
performance_tips.txt
|
||||||
notes.txt
|
notes.txt
|
||||||
|
organisations_using_iris.txt
|
||||||
|
independent_developers_using_iris.txt
|
||||||
|
|
|
@ -10,7 +10,8 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := iris.New()
|
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{
|
authConfig := basicauth.Config{
|
||||||
Users: map[string]string{"myusername": "mypassword", "mySecondusername": "mySecondpassword"},
|
Users: map[string]string{"myusername": "mypassword", "mySecondusername": "mySecondpassword"},
|
||||||
|
|
|
@ -8,7 +8,8 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := iris.New()
|
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{
|
app.Use(i18n.New(i18n.Config{
|
||||||
Default: "en-US",
|
Default: "en-US",
|
||||||
|
|
|
@ -8,13 +8,16 @@ import (
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := iris.New()
|
app := iris.New()
|
||||||
app.Adapt(httprouter.New())
|
// fast way to enable non-fatal messages to be printed to the user
|
||||||
|
|
||||||
app.Adapt(iris.DevLogger()) // 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,
|
// (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,
|
// 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)
|
// 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
|
i := 0
|
||||||
// let's simmilate a panic every next request
|
// let's simmilate a panic every next request
|
||||||
|
|
Loading…
Reference in New Issue
Block a user