orangesite/hn/handlers.go

24 lines
448 B
Go
Raw Normal View History

2020-03-24 20:32:35 +00:00
package hn
import (
"net/http"
2020-03-25 00:49:19 +00:00
"time"
2020-03-24 20:32:35 +00:00
2020-03-25 00:49:19 +00:00
"github.com/flosch/pongo2"
2020-03-24 20:32:35 +00:00
"github.com/labstack/echo"
)
func indexHandler(c echo.Context) error {
2020-03-25 00:49:19 +00:00
tc := pongo2.Context{
"time": time.Now().UTC().Format(time.RFC3339Nano),
}
return c.Render(http.StatusOK, "index.html", tc)
}
func aboutHandler(c echo.Context) error {
tc := pongo2.Context{
"time": time.Now().UTC().Format(time.RFC3339Nano),
}
return c.Render(http.StatusOK, "about.html", tc)
2020-03-24 20:32:35 +00:00
}