diff --git a/demo/blog/blog.go b/demo/blog/blog.go index b56f142..5a89219 100644 --- a/demo/blog/blog.go +++ b/demo/blog/blog.go @@ -9,6 +9,9 @@ import ( func main() { y := yap.New(os.DirFS(".")) + y.GET("/", func(ctx *yap.Context) { + ctx.TEXT(200, "text/html", `
Hello, YAP!`) + }) y.GET("/p/:id", func(ctx *yap.Context) { ctx.YAP(200, "article", yap.H{ "id": ctx.Param("id"), diff --git a/demo/blog/yap/article_yap.html b/demo/blog/yap/article_yap.html index 7985956..8cf77a6 100644 --- a/demo/blog/yap/article_yap.html +++ b/demo/blog/yap/article_yap.html @@ -1,8 +1,4 @@ - - - - -Article {{.id}} - - + +Article {{.id}} +