render html

trunk
vilmibm 2023-07-11 07:42:27 +00:00
parent fd55b6995b
commit 3e539dc1dd
1 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@ type chunk struct {
func main() { func main() {
r := gin.Default() r := gin.Default()
r.LoadHTMLFiles("templates/index.tmpl")
randMax := big.NewInt(maxID) randMax := big.NewInt(maxID)
@ -68,7 +69,7 @@ func main() {
c.String(http.StatusInternalServerError, "oh no.") c.String(http.StatusInternalServerError, "oh no.")
} }
c.String(http.StatusOK, "%s\n\n(%s by %s)", dest.Chunk, dest.Name, dest.Author) c.HTML(http.StatusOK, "index.tmpl", dest)
}) })
r.Run() // 8080 r.Run() // 8080
} }