diff --git a/src/database/activities.go b/src/database/activities.go index 95d7acd..23ed659 100644 --- a/src/database/activities.go +++ b/src/database/activities.go @@ -102,7 +102,7 @@ func CreateActivity(a Activity) (int, error) { query := ` INSERT INTO activities (spots, activity_type, room, speaker, topic, description, time, day, time_stamp, image) - VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9) + VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id ` var id int diff --git a/src/main.go b/src/main.go index 93529ea..bb727fa 100644 --- a/src/main.go +++ b/src/main.go @@ -29,11 +29,14 @@ func main() { mux := http.NewServeMux() LoadRoutes(mux) + certFile := "/etc/letsencrypt/live/sctiuenf.com.br/fullchain.pem" + keyFile := "/etc/letsencrypt/live/sctiuenf.com.br/privkey.pem" + server := http.Server{ - Addr: ":8080", // adicione :xx na URL do .env se a porta não for a padrão do protocolo + Addr: ":443", Handler: middleware.EndpointLogging(mux), } - fmt.Printf("Server Started at: %s\n", os.Getenv("URL")) - log.Fatal(server.ListenAndServe()) + fmt.Printf("Server started at: %s\n", os.Getenv("URL")) + log.Fatal(server.ListenAndServeTLS(certFile, keyFile)) } diff --git a/src/rotas/dashboard/qrcode.go b/src/rotas/dashboard/qrcode.go index f8b27ed..2eed07a 100644 --- a/src/rotas/dashboard/qrcode.go +++ b/src/rotas/dashboard/qrcode.go @@ -49,7 +49,6 @@ func AllUsersSentQR(w http.ResponseWriter, r *http.Request) { for _, user := range users { qrSent, err := DB.IsUserQR(user.Email) if err != nil { - fmt.Printf("Erro ao verificar status do QR para usuário %s: %v\n", user.Email, err) Erros.LogError("dashboard/qrcode.go", fmt.Errorf("Erro ao verificar status do QR para usuário %s: %v\n", user.Email, err)) failedCount++ continue