plakken/main.go
Ada 28b210a245
Some checks failed
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline failed
WIP
2024-05-16 15:49:01 +02:00

38 lines
814 B
Go

package main
import (
"embed"
"git.gnous.eu/gnouseu/plakken/internal/config"
"git.gnous.eu/gnouseu/plakken/internal/database"
"git.gnous.eu/gnouseu/plakken/internal/httpserver"
"log"
"time"
)
var (
//go:embed templates
templates embed.FS
//go:embed static
static embed.FS
)
func main() {
initConfig := config.GetConfig()
dbConfig := database.InitDB(initConfig.RedisAddress, initConfig.RedisUser, initConfig.RedisPassword, initConfig.RedisDB)
db := database.ConnectDB(dbConfig)
err := database.Ping(db)
if err != nil {
log.Fatal(err)
}
serverConfig := httpserver.ServerConfig{
HTTPServer: httpserver.Config(initConfig.ListenAddress),
URLLength: initConfig.URLLength,
DB: db,
Static: static,
Templates: templates,
StartTime: time.Now(),
}
serverConfig.Server()
}