This commit is contained in:
@@ -19,7 +19,7 @@ func ListComicsGetHandler(c *gin.Context) {
|
||||
|
||||
result := schema.DB.Find(&comics)
|
||||
logger.Info("found Comics", "count", result.RowsAffected)
|
||||
c.HTML(http.StatusOK, "comic_comics.tmpl", gin.H{
|
||||
c.HTML(http.StatusOK, "comics.html", gin.H{
|
||||
"title": "Kontor Comics",
|
||||
"version": "0.4.0",
|
||||
"content": "Media Files...",
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"log/slog"
|
||||
"os"
|
||||
"time"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"gorm.io/driver/postgres"
|
||||
"gorm.io/gorm"
|
||||
@@ -18,12 +18,12 @@ func Connect() {
|
||||
// Build the connection string from environment variables
|
||||
// This keeps sensitive credentials out of the codebase
|
||||
dsn := fmt.Sprintf(
|
||||
"host=%s user=%s password=%s dbname=%s port=%s sslmode=disable",
|
||||
os.Getenv("DB_HOST"),
|
||||
os.Getenv("DB_USER"),
|
||||
os.Getenv("DB_PASSWORD"),
|
||||
os.Getenv("DB_NAME"),
|
||||
os.Getenv("DB_PORT"),
|
||||
"host=%s user=%s password=%s dbname=%s port=%d sslmode=disable",
|
||||
viper.GetString("db.host"),
|
||||
viper.GetString("db.user"),
|
||||
viper.GetString("db.password"),
|
||||
viper.GetString("db.name"),
|
||||
viper.GetInt("db.port"),
|
||||
)
|
||||
|
||||
// Configure GORM with custom settings
|
||||
|
||||
Reference in New Issue
Block a user