feat(mail): #132 unify env variables and send mails with smtp
This commit is contained in:
@@ -1,21 +1,15 @@
|
||||
package middleware
|
||||
|
||||
import (
|
||||
"log"
|
||||
"log/slog"
|
||||
"me-fit/utils"
|
||||
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
||||
func EnableCors(next http.Handler) http.Handler {
|
||||
var base_url = os.Getenv("BASE_URL")
|
||||
if base_url == "" {
|
||||
log.Fatal("BASE_URL is not set")
|
||||
}
|
||||
slog.Info("BASE_URL is " + base_url)
|
||||
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", base_url)
|
||||
w.Header().Set("Access-Control-Allow-Origin", utils.BaseUrl)
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, DELETE")
|
||||
|
||||
if r.Method == "OPTIONS" {
|
||||
|
||||
Reference in New Issue
Block a user