Skip to content

Commit e59768d

Browse files
Fennygitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent f8bc8b4 commit e59768d

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

application.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: The app instance conventionally denotes the Fiber application.
66

77
## New
88

9-
This method creates a new **App** named instance.
9+
This method creates a new **App** named instance.
1010
You can pass optional [settings ](application.md#settings)when creating a new instance.
1111

1212
{% code title="Signature" %}
@@ -83,7 +83,7 @@ func main() {
8383
| CaseSensitive | `bool` | When enabled, `/Foo` and `/foo` are different routes. When disabled, `/Foo`and `/foo` are treated the same. | `false` |
8484
| Immutable | `bool` | When enabled, all values returned by context methods are immutable. By default they are valid until you return from the handler, see issue [\#185](https://github.com/gofiber/fiber/issues/185). | `false` |
8585
| BodyLimit | `int` | Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends `413 - Request Entity Too Large` response. | `4 * 1024 * 1024` |
86-
| TemplateEngine | `func(raw string, bind interface{}) (string, error)` | You can specify a custom template function to render different template languages. See our [**Template Middleware**](middleware.md#template) ****for presets. | `nil` |
86+
| TemplateEngine | `func(raw string, bind interface{}) (string, error)` | You can specify a custom template function to render different template languages. See our [**Template Middleware**](middleware.md#template) _\*\*_for presets. | `nil` |
8787
| TemplateFolder | `string` | A directory for the application's views. If a directory is set, this will be the prefix for all template paths. `c.Render("home", data) -> ./views/home.pug` | `""` |
8888
| TemplateExtension | `string` | If you preset the template file extension, you do not need to provide the full filename in the Render function: `c.Render("home", data) -> home.pug` | `"html"` |
8989
| ReadTimeout | `time.Duration` | The amount of time allowed to read the full request including body. Default timeout is unlimited. | `nil` |
@@ -271,7 +271,7 @@ app.Listen("127.0.0.1:8080")
271271
```
272272
{% endcode %}
273273

274-
To enable **TLS/HTTPS** you can append a **[TLS config](https://golang.org/pkg/crypto/tls/#Config)**.
274+
To enable **TLS/HTTPS** you can append a [**TLS config**](https://golang.org/pkg/crypto/tls/#Config).
275275

276276
{% code title="Example" %}
277277
```go

middleware.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ func main() {
473473
app.Use(requestid.New())
474474

475475
app.Get("/", func(c *fiber.Ctx) {
476-
c.Send("Hello, World!")
476+
c.Send(requestid.Get(c))
477477
})
478478

479479
app.Listen(3000)
@@ -535,7 +535,6 @@ func main() {
535535
}
536536
```
537537

538-
539538
## Redirect
540539

541540
Redirects middleware provides an HTTP redirect to the URL derived from the specified path, with specified status, a positive integer that corresponds to an HTTP status code.
@@ -564,22 +563,23 @@ import (
564563

565564
func main() {
566565
app := fiber.New()
567-
566+
568567
app.Use(redirect.New(redirect.Config{
569568
Rules: map[string]string{
570569
"/old": "/new",
571570
"/old/*": "/new/$1",
572571
},
573572
Status: 301,
574573
}))
575-
574+
576575
app.Get("/new", func(c *fiber.Ctx) {
577576
c.Send("Hello, World!")
578577
})
579578
app.Get("/new/*", func(c *fiber.Ctx) {
580579
c.Send("Wildcard: ", c.Params("*"))
581580
})
582-
581+
583582
app.Listen(3000)
584583
}
585584
```
585+

0 commit comments

Comments
 (0)