mirror of https://github.com/gofiber/fiber.git
Update whats_new.md documentation
parent
6a36f6d4e6
commit
86fd29ac27
|
@ -68,7 +68,6 @@ We have made several changes to the Fiber app, including:
|
||||||
- **Listen**: Now has a configuration parameter.
|
- **Listen**: Now has a configuration parameter.
|
||||||
- **Listener**: Now has a configuration parameter.
|
- **Listener**: Now has a configuration parameter.
|
||||||
|
|
||||||
|
|
||||||
### CTX interface + customizable
|
### CTX interface + customizable
|
||||||
|
|
||||||
Fiber v3 introduces a more customizable `Ctx` interface, allowing developers to create their own context classes. This flexibility enables you to extend the default context with additional methods and properties tailored to your application's needs.
|
Fiber v3 introduces a more customizable `Ctx` interface, allowing developers to create their own context classes. This flexibility enables you to extend the default context with additional methods and properties tailored to your application's needs.
|
||||||
|
@ -142,7 +141,6 @@ In this example, the `CustomCtx` struct extends the default `fiber.Ctx` with a c
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
## 🗺 Router
|
## 🗺 Router
|
||||||
|
|
||||||
We have slightly adapted our router interface
|
We have slightly adapted our router interface
|
||||||
|
@ -609,6 +607,7 @@ curl "http://localhost:3000/query?age=25"
|
||||||
curl "http://localhost:3000/query?age=abc"
|
curl "http://localhost:3000/query?age=abc"
|
||||||
# Output: 0
|
# Output: 0
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
@ -640,6 +639,7 @@ curl -H "User-Agent: CustomAgent" "http://localhost:3000/header"
|
||||||
curl "http://localhost:3000/header"
|
curl "http://localhost:3000/header"
|
||||||
# Output: "Unknown"
|
# Output: "Unknown"
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
## 🧬 Middlewares
|
## 🧬 Middlewares
|
||||||
|
@ -1095,6 +1095,7 @@ app.Get("/old", func(c fiber.Ctx) error {
|
||||||
return c.Redirect().Route("newRoute")
|
return c.Redirect().Route("newRoute")
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
2. **RedirectBack**: Use `c.Redirect().Back()` instead of `c.RedirectBack()`.
|
2. **RedirectBack**: Use `c.Redirect().Back()` instead of `c.RedirectBack()`.
|
||||||
|
@ -1115,6 +1116,7 @@ app.Get("/back", func(c fiber.Ctx) error {
|
||||||
return c.Redirect().Back()
|
return c.Redirect().Back()
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
3. **Redirect**: Use `c.Redirect().To()` instead of `c.Redirect()`.
|
3. **Redirect**: Use `c.Redirect().To()` instead of `c.Redirect()`.
|
||||||
|
@ -1135,6 +1137,7 @@ app.Get("/old", func(c fiber.Ctx) error {
|
||||||
return c.Redirect().To("/new")
|
return c.Redirect().To("/new")
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### 🌎 Client package
|
### 🌎 Client package
|
||||||
|
@ -1149,7 +1152,7 @@ Fiber v3 introduces a completely rebuilt client package with numerous new featur
|
||||||
|
|
||||||
#### Migration Instructions
|
#### Migration Instructions
|
||||||
|
|
||||||
**Import Path**
|
**Import Path**:
|
||||||
|
|
||||||
Update the import path to the new client package.
|
Update the import path to the new client package.
|
||||||
|
|
||||||
|
@ -1159,6 +1162,7 @@ Update the import path to the new client package.
|
||||||
```go
|
```go
|
||||||
import "github.com/gofiber/fiber/v2/client"
|
import "github.com/gofiber/fiber/v2/client"
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
|
@ -1167,6 +1171,7 @@ import "github.com/gofiber/fiber/v2/client"
|
||||||
```go
|
```go
|
||||||
import "github.com/gofiber/fiber/v3/client"
|
import "github.com/gofiber/fiber/v3/client"
|
||||||
```
|
```
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
:::caution
|
:::caution
|
||||||
|
|
Loading…
Reference in New Issue