feat(mail): #132 unify env variables and send mails with smtp

This commit is contained in:
2024-09-05 17:54:39 +02:00
parent 0872728f3a
commit 5172a30781
7 changed files with 111 additions and 22 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"me-fit/middleware"
"me-fit/service"
"me-fit/utils"
"database/sql"
"net/http"
@@ -13,6 +14,10 @@ func getHandler(db *sql.DB) http.Handler {
router.HandleFunc("/", service.HandleIndexAnd404(db))
router.HandleFunc("/mail", func(w http.ResponseWriter, r *http.Request) {
utils.SendWelcomeMail("timwundenberg@outlook.de")
})
// Serve static files (CSS, JS and images)
router.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))