亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

老師您好 能幫我看看問題在哪兒么?

package?main

import?(
???"github.com/kataras/iris"
)

func?main()?{
???app?:=?iris.New()

???app.RegisterView(iris.HTML("./views",?".html"))

???app.Get("/",?func(ctx?iris.Context)?{
??????ctx.ViewData("message",?"Hello?world!")
??????ctx.View("hello.html")
???})

???app.Run(iris.Addr(":8080"))
}


<html>
<head>
????<title>Hello?Page</title>
</head>
<body>
<h1>{{.message}}</h1>
</body>
</html>

https://img1.sycdn.imooc.com//5be4108800016ba519400632.jpg


https://img1.sycdn.imooc.com//5be41099000198e914080398.jpg



正在回答

1 回答

模板文件位置換成絕對路徑就可以了

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

老師您好 能幫我看看問題在哪兒么?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號