Skip to content

Commit

Permalink
[Backend] Fiber optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfex4936 committed Feb 20, 2024
1 parent c18a721 commit ab23114
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,13 @@ func main() {
StrictRouting: true,
ServerHeader: "",
BodyLimit: 10 * 1024 * 1024, // limit to 10 MB
IdleTimeout: 120 * time.Second,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
})

app.Server().MaxConnsPerIP = 100

// Enable CORS for all routes
app.Use(cors.New(cors.Config{
AllowOrigins: "*", // Allows all origins
Expand Down Expand Up @@ -91,8 +96,9 @@ func main() {
{
markerGroup.Use(middlewares.AuthMiddleware)
markerGroup.Post("/new", handlers.CreateMarkerWithPhotosHandler)
markerGroup.Get("/:id", handlers.GetMarker)
markerGroup.Get("/", handlers.GetAllMarkersHandler)
markerGroup.Get("", handlers.GetAllMarkersHandler)
markerGroup.Get("/:id", handlers.GetMarker)
markerGroup.Put("/:id", handlers.UpdateMarker)
markerGroup.Post("/upload", handlers.UploadMarkerPhotoToS3Handler)
markerGroup.Delete("/:markerID", handlers.DeleteMarkerHandler)
Expand Down

0 comments on commit ab23114

Please sign in to comment.