diff --git a/main.go b/main.go index d162fa2..1eec4a4 100644 --- a/main.go +++ b/main.go @@ -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() @@ -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") }