collinenlucy.nl/main.go
2025-09-03 14:39:11 +02:00

26 lines
495 B
Go

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