diff --git a/_examples/README.md b/_examples/README.md index 6aca38bd..ffc3721b 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -7,6 +7,7 @@ It doesn't contains "best ways" neither explains all its features. It's just a s ## Table of contents * [Level: Beginner](beginner) + * [Hello world](beginner/hello-world/main.go) * [Overview](beginner/overview/main.go) * [Listening](beginner/listening) * [Common, with address](beginner/listening/listen-addr/main.go) diff --git a/_examples/beginner/hello-world/main.go b/_examples/beginner/hello-world/main.go new file mode 100644 index 00000000..f2e95ed0 --- /dev/null +++ b/_examples/beginner/hello-world/main.go @@ -0,0 +1,14 @@ +package main + +import ( + "github.com/kataras/iris" + "github.com/kataras/iris/context" +) + +func main() { + app := iris.New() + app.Handle("GET", "/", func(ctx context.Context) { + ctx.HTML(" Hello world! ") + }) + app.Run(iris.Addr(":8080")) +}