29 lines
436 B
Go
29 lines
436 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
"email-notification/config"
|
|
"email-notification/route"
|
|
"log"
|
|
"net/http"
|
|
"os"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
func main() {
|
|
log.Println("Email Notification Service")
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
log.Fatal("Error loading .env file")
|
|
}
|
|
|
|
db := config.NewDatabase().WithContext(context.Background())
|
|
|
|
route.Route(db)
|
|
|
|
port := os.Getenv("PORT")
|
|
|
|
http.ListenAndServe(":"+port, nil)
|
|
}
|