collinenlucy.nl/main.go

27 lines
464 B
Go
Raw Normal View History

2025-06-30 12:37:33 +02:00
package main
import (
2025-06-30 12:37:33 +02:00
"fmt"
2025-06-30 12:37:33 +02:00
"net/http"
2025-06-30 12:37:33 +02:00
"github.com/joho/godotenv"
2025-06-30 12:37:33 +02:00
_ "github.com/mattn/go-sqlite3"
)
func main() {
2025-06-30 12:37:33 +02:00
godotenv.Load(".env")
2025-06-30 12:37:33 +02:00
ntfy := SetupNtfyClient()
db := SetupDatabase()
SetupRsvpsTable(db)
visits := SetupVisitHandler(&VisitHandlerArgs{baseUrl: "http://ip-api.com", rateLimitAmount: 45, rateLimitDurationSeconds: 60})
2025-06-30 12:37:33 +02:00
SetupAuth()
hnd := &Handler{db, ntfy, visits}
2025-06-30 12:37:33 +02:00
fmt.Println("handler ready")
2025-06-30 12:37:33 +02:00
http.ListenAndServe(":8000", hnd)
}