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
|
|
|
}
|