From fc238b4f66f3bba701fd2caec9bec3ff8cb67529 Mon Sep 17 00:00:00 2001 From: Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> Date: Sat, 19 Oct 2024 18:11:01 +0300 Subject: stop pushing local changes idiot --- backend/main.go | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'backend/main.go') diff --git a/backend/main.go b/backend/main.go index 6499b51..e7a0ede 100644 --- a/backend/main.go +++ b/backend/main.go @@ -4,13 +4,11 @@ import ( "fmt" "log" "os" - "time" "lphub/api" "lphub/database" _ "lphub/docs" - "github.com/gin-contrib/cors" "github.com/gin-gonic/gin" "github.com/joho/godotenv" ) @@ -36,19 +34,19 @@ func main() { database.ConnectDB() api.InitRoutes(router) // for debugging - router.Use(cors.New(cors.Config{ - AllowOrigins: []string{"*"}, - AllowMethods: []string{"GET", "POST", "DELETE", "PUT", "PATCH"}, - AllowHeaders: []string{"Origin"}, - ExposeHeaders: []string{"Content-Length"}, - AllowCredentials: true, - MaxAge: 12 * time.Hour, - })) - router.Static("/static", "../frontend/build/static") - router.StaticFile("/", "../frontend/build/index.html") - router.NoRoute(func(c *gin.Context) { - c.File("../frontend/build/index.html") - }) + // router.Use(cors.New(cors.Config{ + // AllowOrigins: []string{"*"}, + // AllowMethods: []string{"GET", "POST", "DELETE", "PUT", "PATCH"}, + // AllowHeaders: []string{"Origin"}, + // ExposeHeaders: []string{"Content-Length"}, + // AllowCredentials: true, + // MaxAge: 12 * time.Hour, + // })) + // router.Static("/static", "../frontend/build/static") + // router.StaticFile("/", "../frontend/build/index.html") + // router.NoRoute(func(c *gin.Context) { + // c.File("../frontend/build/index.html") + // }) router.MaxMultipartMemory = 200 << 20 // 200 mb limit for demos router.Run(fmt.Sprintf(":%s", os.Getenv("PORT"))) } -- cgit v1.2.3