new file: .env
new file: bot.db new file: db/db.go new file: go.mod new file: go.sum new file: handlers/dashboard.go new file: handlers/webhook.go new file: main.go new file: services/openrouter.go new file: services/whatsapp.go new file: templates/dashboard.html new file: types/types.go
This commit is contained in:
31
main.go
Normal file
31
main.go
Normal file
@@ -0,0 +1,31 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"whatsapp-bot/db"
|
||||
"whatsapp-bot/handlers"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func main() {
|
||||
db.Init()
|
||||
|
||||
r := gin.Default()
|
||||
|
||||
// Load templates so Gin knows where to find your HTML
|
||||
r.LoadHTMLGlob("templates/*")
|
||||
|
||||
// Routes
|
||||
r.GET("/webhook", handlers.VerifyWebhook)
|
||||
r.POST("/webhook", handlers.HandleMessage)
|
||||
r.GET("/dashboard", handlers.ShowDashboard)
|
||||
r.POST("/admin/test-ai", handlers.TestAIHandler)
|
||||
r.DELETE("/admin/appointment/:id", handlers.DeleteAppointmentHandler)
|
||||
|
||||
// A little something for the root so you don't get a 404 again, seki
|
||||
r.GET("/", func(c *gin.Context) {
|
||||
c.JSON(200, gin.H{"message": "Bot is running. Go to /dashboard"})
|
||||
})
|
||||
|
||||
r.Run(":9090") // Using your port 9090 from the screenshot
|
||||
}
|
||||
Reference in New Issue
Block a user