Skip to content

Commit d5aac02

Browse files
authored
[Go] Prepare next release for fiber (the-benchmarker#2448)
1 parent 790747b commit d5aac02

2 files changed

Lines changed: 22 additions & 9 deletions

File tree

go/fiber/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module main
22

3-
require github.com/gofiber/fiber v1.8.431
3+
require github.com/gofiber/fiber v1.8.431

go/fiber/main.go

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,36 @@
11
package main
22

33
import (
4-
"strings"
5-
64
"github.com/gofiber/fiber"
75
)
86

9-
const pathUser = "/user/"
10-
117
func main() {
128
app := fiber.New(&fiber.Settings{
139
Prefork: true,
1410
CaseSensitive: true,
1511
StrictRouting: true,
1612
})
17-
app.Use(func(c *fiber.Ctx) {
18-
if strings.HasPrefix(c.Path(), pathUser) {
19-
c.SendString(c.Path()[6:])
20-
}
13+
app.Get("/", func(c *fiber.Ctx) {
14+
c.SendString("")
2115
})
16+
app.Get("/user/:id", func(c *fiber.Ctx) {
17+
c.SendString(c.Params("id"))
18+
})
19+
// app.Get("/user/1", func(c *fiber.Ctx) {
20+
// c.JSON("")
21+
// })
22+
// app.Post("/user", func(c *fiber.Ctx) {
23+
// c.JSON("")
24+
// })
25+
// app.Put("/user/1", func(c *fiber.Ctx) {
26+
// c.JSON("")
27+
// })
28+
// app.Patch("/user/1", func(c *fiber.Ctx) {
29+
// c.JSON("")
30+
// })
31+
// app.Delete("/user/1", func(c *fiber.Ctx) {
32+
// c.JSON("")
33+
// })
34+
2235
app.Listen(3000)
2336
}

0 commit comments

Comments
 (0)