Skip to content

Commit 46f85a0

Browse files
authored
Update main.go for deployment
1 parent 5f06a5f commit 46f85a0

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

server/main.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ func main() {
2626
fmt.Println("hello world")
2727

2828
if os.Getenv("ENV") != "production" {
29-
// Load the .env file if not in production
30-
// err := godotenv.Load(".env")
31-
// if err != nil {
32-
// log.Fatal("Error loading .env file:", err)
33-
// }
29+
Load the .env file if not in production
30+
err := godotenv.Load(".env")
31+
if err != nil {
32+
log.Fatal("Error loading .env file:", err)
33+
}
3434
}
3535

3636
MONGODB_URI := os.Getenv("MONGODB_URI")
@@ -54,10 +54,10 @@ func main() {
5454

5555
app := fiber.New()
5656

57-
app.Use(cors.New(cors.Config{
58-
AllowOrigins: "http://localhost:5173",
59-
AllowHeaders: "Origin,Content-Type,Accept",
60-
}))
57+
// app.Use(cors.New(cors.Config{
58+
// AllowOrigins: "http://localhost:5173",
59+
// AllowHeaders: "Origin,Content-Type,Accept",
60+
// }))
6161

6262
app.Get("/api/todos", getTodos)
6363
app.Post("/api/todos", createTodo)

0 commit comments

Comments
 (0)