Skip to content

Commit

Permalink
✨ use /line/webhook in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
Shion1305 committed Oct 11, 2024
1 parent dbf1ad1 commit 9d4a95a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
package main

import "github.com/gin-gonic/gin"
import (
"github.com/a-company/yoriai-backend/pkg/handler"
"github.com/a-company/yoriai-backend/pkg/service/line"
"github.com/gin-gonic/gin"
"log/slog"
)

func main() {
e := gin.Default()
Expand All @@ -10,5 +15,14 @@ func main() {
"message": "Hello World",
})
})

lineBotSvc, err := line.NewLINEBotService()
if err != nil {
slog.Error("failed to initialize line bot service", err)
return
}

lineWHandler := handler.NewLINEWebhookHandler(lineBotSvc)
e.Any("/line/webhook", lineWHandler.Handle)
e.Run(":8080")
}

0 comments on commit 9d4a95a

Please sign in to comment.