Render empty index template

pull/1/head
Nikita Tokarchuk 3 years ago
parent e853eea486
commit 48df063c86
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 15
      frontend/renderer/index.go
  2. 3
      frontend/renderer/renderer.go

@ -0,0 +1,15 @@
package renderer
import (
"code.tokarch.uk/mainnika/nikita-tokarch-uk/frontend/content"
routing "github.com/jackwhelpton/fasthttp-routing/v2"
)
// index handler renders index data
func (r *Renderer) index(c *routing.Context) (err error) {
indexContent := content.Index{
}
return c.Write(indexContent)
}

@ -33,7 +33,10 @@ func (r *Renderer) init() {
router.Use(r.useErrorHandler)
router.NotFound(r.errorNotFound)
root := router.Group(r.Base)
root.Get(templates.URLIndex, r.index)
root.Get(templates.URLBlog, r.blog)
r.router = router
r.handler = router.HandleRequest
}

Loading…
Cancel
Save