Skip to content

Commit

Permalink
Merge pull request #45 from backdevs/44-support-only-get-requests
Browse files Browse the repository at this point in the history
Support only GET requests
  • Loading branch information
bogdannbv authored Feb 20, 2024
2 parents 7b9cef4 + 2b763d5 commit c33430a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Bogdan
Copyright (c) 2022 Backdevs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

func main() {
app := fiber.New(fiber.Config{
GETOnly: true,
ErrorHandler: func(c *fiber.Ctx, err error) error {
code := fiber.StatusInternalServerError

Expand All @@ -25,7 +26,7 @@ func main() {
},
})

app.All("/", func(c *fiber.Ctx) error {
app.Get("/", func(c *fiber.Ctx) error {
queryYear := c.Query("year", carbon.Now().Format("Y"))

year, err := strconv.Atoi(queryYear)
Expand Down

0 comments on commit c33430a

Please sign in to comment.