This repository has been archived on 2025-07-20. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
hn84/ui/main.go
2023-11-05 10:52:41 +00:00

24 lines
507 B
Go

package main
import (
"git.tdpain.net/codemicro/hn84/ui/internal/config"
"git.tdpain.net/codemicro/hn84/ui/internal/database"
"git.tdpain.net/codemicro/hn84/ui/internal/httpcore"
"git.tdpain.net/codemicro/hn84/util"
"log/slog"
)
func main() {
if err := run(); err != nil {
slog.Error("unhandled error", "error", err)
}
}
func run() error {
db, err := database.Setup(config.Get().DatabaseName)
if err != nil {
return util.Wrap("setup database", err)
}
return httpcore.ListenAndServe(db)
}