2017-07-18 20:17:23 +02:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2019-10-25 00:27:02 +02:00
|
|
|
"github.com/kataras/iris/v12/_examples/http_responsewriter/quicktemplate/controllers"
|
2017-07-18 20:17:23 +02:00
|
|
|
|
2019-10-25 00:27:02 +02:00
|
|
|
"github.com/kataras/iris/v12"
|
2017-07-18 20:17:23 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
func newApp() *iris.Application {
|
|
|
|
app := iris.New()
|
|
|
|
app.Get("/", controllers.Index)
|
|
|
|
app.Get("/{name}", controllers.Hello)
|
|
|
|
|
|
|
|
return app
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := newApp()
|
|
|
|
// http://localhost:8080
|
|
|
|
// http://localhost:8080/yourname
|
|
|
|
app.Run(iris.Addr(":8080"), iris.WithoutServerError(iris.ErrServerClosed))
|
|
|
|
}
|