From 050232bde2af6a634d7d517f75860faacef8eaae Mon Sep 17 00:00:00 2001 From: cp-sumi-k Date: Mon, 18 Sep 2023 16:10:47 +0530 Subject: [PATCH] Remove all routes --- main.go | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/main.go b/main.go index 68b8f7702..09f67170e 100644 --- a/main.go +++ b/main.go @@ -1,19 +1,10 @@ package main import ( - "blogs" - "contact" "context" - "contribution" - "db" "embed" - "jobs" - "leave" "net/http" - "notification" "os" - "sitemap" - "utils" "github.com/aws/aws-lambda-go/events" "github.com/aws/aws-lambda-go/lambda" @@ -47,41 +38,41 @@ func LambdaHandler(ctx context.Context, req events.APIGatewayProxyRequest) (even func setupRouter() *gin.Engine { - sqlDb := db.NewSql() + // sqlDb := db.NewSql() router := gin.Default() router.Use(cors.New(corsConfig())) router.Use(gzip.Gzip(gzip.DefaultCompression)) - utilsRepo := utils.NewEmail() - contactRepo := contact.New(templateFS, utilsRepo) - jobsRepo := jobs.New(sqlDb, templateFS, utilsRepo) - sitemapRepo := sitemap.New(jobsRepo) - leaveRepo := leave.New(templateFS, utilsRepo) - notificationRepo := notification.New(templateFS, utilsRepo) + // utilsRepo := utils.NewEmail() + // contactRepo := contact.New(templateFS, utilsRepo) + // jobsRepo := jobs.New(sqlDb, templateFS, utilsRepo) + // sitemapRepo := sitemap.New(jobsRepo) + // leaveRepo := leave.New(templateFS, utilsRepo) + // notificationRepo := notification.New(templateFS, utilsRepo) - router.POST("/api/send-contact-mail", contactRepo.SendContactMail) + // router.POST("/api/send-contact-mail", contactRepo.SendContactMail) - router.GET("/api/careers", jobsRepo.Careers) + // router.GET("/api/careers", jobsRepo.Careers) - router.GET("/api/careers/:unique_id", jobsRepo.CareerById) + // router.GET("/api/careers/:unique_id", jobsRepo.CareerById) - router.POST("/api/send-jobs-applications", jobsRepo.SaveApplicationsData) + // router.POST("/api/send-jobs-applications", jobsRepo.SaveApplicationsData) - router.GET("/api/sitemap", sitemapRepo.GenerateSitemap) + // router.GET("/api/sitemap", sitemapRepo.GenerateSitemap) - router.GET("/api/blogs", blogs.Get) + // router.GET("/api/blogs", blogs.Get) - router.GET("/api/github/stars", contribution.GetStargazers) + // router.GET("/api/github/stars", contribution.GetStargazers) - router.POST("/api/leave/new", leaveRepo.SendLeaveRequest) + // router.POST("/api/leave/new", leaveRepo.SendLeaveRequest) - router.POST("/api/leave/update", leaveRepo.SendUpdateLeaveMail) + // router.POST("/api/leave/update", leaveRepo.SendUpdateLeaveMail) - router.POST("/api/invitation", notificationRepo.SendInvitationMail) + // router.POST("/api/invitation", notificationRepo.SendInvitationMail) - router.POST("/api/acceptence", notificationRepo.SendAcceptenceMail) + // router.POST("/api/acceptence", notificationRepo.SendAcceptenceMail) router.GET("/api/ping", func(c *gin.Context) { c.JSON(200, gin.H{ @@ -99,6 +90,7 @@ func corsConfig() cors.Config { } func main() { + log.Info("router: ", router) router = setupRouter() log.Info("router: ", router) ginLambda = ginadapter.New(router)