Skip to content

Commit

Permalink
Update main.go to properly send a JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdannbv committed Aug 2, 2022
1 parent 897e53b commit 743ef41
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ func main() {
return fiber.NewError(fiber.StatusBadRequest, getJSONError(err.Error()))
}

holidaysJson, _ := json.Marshal(holidays)

return c.Send(holidaysJson)
return c.JSON(holidays)
})

err := app.Listen(":8080")
Expand Down

0 comments on commit 743ef41

Please sign in to comment.