mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 18:37:05 +00:00
Nothing serious yet, thinking new features with the team, post some to help us!
Former-commit-id: 5741c47230bd2f3b88bf9e943742418be664cfdd
This commit is contained in:
@@ -5,10 +5,18 @@ package main
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
"github.com/kataras/iris/context"
|
||||
"github.com/kataras/iris/middleware/logger"
|
||||
"github.com/kataras/iris/middleware/recover"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := iris.Default()
|
||||
app := iris.New()
|
||||
|
||||
// Optionally, add two built'n handlers
|
||||
// that can recover from any http-relative panics
|
||||
// and log the requests to the terminal.
|
||||
app.Use(recover.New())
|
||||
app.Use(logger.New())
|
||||
|
||||
// Method: GET
|
||||
// Resource: http://localhost:8080/
|
||||
@@ -32,5 +40,5 @@ func main() {
|
||||
// http://localhost:8080
|
||||
// http://localhost:8080/ping
|
||||
// http://localhost:8080/hello
|
||||
app.Run(iris.Addr(":8080"))
|
||||
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user