phoenix/views/pages/index.go
Ivan R. 5aa2cee5b1
chore: migrate to database/sql
Since I started simplifying, I decided to abandon ORM.

I won’t say that this makes much sense, everything works more or less as before.
Except that the size of the program has decreased slightly again, by about a megabyte.
2024-03-26 00:40:52 +05:00

25 lines
470 B
Go

package pages
import (
"net/http"
"github.com/ordinary-dev/phoenix/database"
log "github.com/sirupsen/logrus"
)
func ShowMainPage(w http.ResponseWriter, _ *http.Request) {
groups, err := database.GetGroupsWithLinks()
if err != nil {
ShowError(w, http.StatusInternalServerError, err)
return
}
err = Render("index.html.tmpl", w, map[string]any{
"description": "Self-hosted start page.",
"groups": groups,
})
if err != nil {
log.Error(err)
}
}