Creating a database table for items for sale

This commit is contained in:
2024-08-06 21:35:28 +02:00
parent 90918f25ae
commit ab4fda918a
5 changed files with 42 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"html/template"
"log"
"myapp/internal/driver"
"myapp/internal/models"
"net/http"
"os"
"time"
@ -35,6 +36,7 @@ type application struct {
errorLog *log.Logger
templateCache map[string]*template.Template
version string
DB models.DBModel
}
func (app *application) serve() error {
@ -95,6 +97,7 @@ func main() {
errorLog: errorLog,
templateCache: tc,
version: version,
DB: models.DBModel{DB: conn},
}
app.infoLog.Println("Connected to MariaDB")