Switch branches/tags
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 691 Bytes
package main
import (
type mypage struct {
Title string
Message string
func main() {
app := iris.New()
app.RegisterView(iris.HTML("./templates", ".html").Layout("layout.html"))
// TIP: append .Reload(true) to reload the templates on each request.
app.Get("/", func(ctx iris.Context) {
ctx.ViewData("", mypage{"My Page title", "Hello world!"})
// Note that: you can pass "layout" : "otherLayout.html" to bypass the config's Layout property
// or view.NoLayout to disable layout on this render action.
// third is an optional parameter
// http://localhost:8080