mirror of https://github.com/gofiber/fiber.git
Update README.md (#1477)
parent
15987a2677
commit
f014d143ac
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -278,7 +278,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -313,7 +313,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -338,7 +338,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -367,7 +367,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -459,7 +459,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -170,7 +170,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -238,9 +238,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -276,7 +276,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -311,7 +311,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -336,7 +336,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -365,7 +365,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -457,7 +457,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -170,7 +170,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -238,9 +238,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -276,7 +276,7 @@ func main() {
|
|||
|
||||
### Agrupando rutas en cadenas
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -311,7 +311,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -336,7 +336,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -365,7 +365,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Respuesta 404 personalizada
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -457,7 +457,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -218,7 +218,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -300,9 +300,9 @@ func main() {
|
|||
|
||||
</br>
|
||||
|
||||
📖 [پیکربندی](https://docs.gofiber.io/fiber#config)
|
||||
📖 [پیکربندی](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [موتورها](https://github.com/gofiber/template)
|
||||
📖 [رندر](https://docs.gofiber.io/context#render)
|
||||
📖 [رندر](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
<br>
|
||||
<p align="center">
|
||||
|
@ -346,7 +346,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -385,7 +385,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -414,7 +414,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -451,7 +451,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -555,7 +555,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -278,7 +278,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -313,7 +313,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -338,7 +338,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -367,7 +367,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -459,7 +459,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -225,7 +225,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -302,9 +302,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -344,7 +344,7 @@ func main() {
|
|||
|
||||
### קיבוץ routes ל-chains
|
||||
|
||||
📖 [קבוצות](https://docs.gofiber.io/application#group)
|
||||
📖 [קבוצות](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -383,7 +383,7 @@ func main() {
|
|||
|
||||
### Middleware של לוגים
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -412,7 +412,7 @@ func main() {
|
|||
|
||||
### שיתוף משאבים בין מקורות (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -449,7 +449,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### תגובת 404 מותאמת אישית
|
||||
|
||||
📖 [שיטות HTTP](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [שיטות HTTP](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
@ -553,7 +553,7 @@ func main() {
|
|||
|
||||
### Middleware של התאוששות
|
||||
|
||||
📖 [התאוששות](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [התאוששות](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
<div dir="ltr">
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -278,7 +278,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -313,7 +313,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -338,7 +338,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -367,7 +367,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -459,7 +459,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -175,7 +175,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -243,9 +243,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -281,7 +281,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -316,7 +316,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -341,7 +341,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -370,7 +370,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -462,7 +462,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -176,7 +176,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -244,9 +244,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -282,7 +282,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -317,7 +317,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -342,7 +342,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -371,7 +371,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -463,7 +463,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -176,7 +176,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -244,9 +244,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -282,7 +282,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -317,7 +317,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -342,7 +342,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -371,7 +371,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -463,7 +463,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### Engines de visualização
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
O Fiber usa por padrão o [html/template](https://golang.org/pkg/html/template/) quando nenhuma engine é selecionada.
|
||||
|
||||
|
@ -276,7 +276,7 @@ func main() {
|
|||
|
||||
### Agrupamento de rotas
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -311,7 +311,7 @@ func main() {
|
|||
|
||||
### Middleware Logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -336,7 +336,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -365,7 +365,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Resposta 404 customizada
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -457,7 +457,7 @@ func main() {
|
|||
|
||||
### Middleware Recover
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Если не указано ни одного движка для views, Fiber использует [html/template](https://golang.org/pkg/html/template/).
|
||||
|
||||
|
@ -277,7 +277,7 @@ func main() {
|
|||
|
||||
### Группировка путей в цепочки
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -312,7 +312,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -336,7 +336,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -366,7 +366,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Custom 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -463,7 +463,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -188,7 +188,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -266,9 +266,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -308,7 +308,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
<div dir="ltr" >
|
||||
|
||||
|
@ -347,7 +347,7 @@ func main() {
|
|||
|
||||
### Middleware logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
<div dir="ltr" >
|
||||
|
||||
|
@ -376,7 +376,7 @@ func main() {
|
|||
|
||||
### Cross-Origin Resource Sharing (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
<div dir="ltr" >
|
||||
|
||||
|
@ -413,7 +413,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### مخصص 404 response
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
<div dir="ltr" >
|
||||
|
||||
|
@ -517,7 +517,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
<div dir="ltr" >
|
||||
|
||||
|
|
|
@ -170,7 +170,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -238,9 +238,9 @@ func main() {
|
|||
|
||||
### Views engines
|
||||
|
||||
📖 [Config](https://docs.gofiber.io/fiber#config)
|
||||
📖 [Config](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [Engines](https://github.com/gofiber/template)
|
||||
📖 [Render](https://docs.gofiber.io/context#render)
|
||||
📖 [Render](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
Fiber defaults to the [html/template](https://golang.org/pkg/html/template/) when no view engine is set.
|
||||
|
||||
|
@ -276,7 +276,7 @@ func main() {
|
|||
|
||||
### Rotaları Zincirlere Gruplama
|
||||
|
||||
📖 [Grup](https://docs.gofiber.io/application#group)
|
||||
📖 [Grup](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -310,7 +310,7 @@ func main() {
|
|||
|
||||
### Ara Katman Günlükcüsü(Logger)
|
||||
|
||||
📖 [Günlükcü](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Günlükcü](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -335,7 +335,7 @@ func main() {
|
|||
|
||||
### Farklı Merkezler Arası Kaynak Paylaşımı (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -364,7 +364,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### Özelleştirilebilir 404 yanıtları
|
||||
|
||||
📖 [HTTP Methodlari](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methodlari](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -456,7 +456,7 @@ func main() {
|
|||
|
||||
### Recover middleware
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -172,7 +172,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -240,9 +240,9 @@ func main() {
|
|||
|
||||
### 模版引擎
|
||||
|
||||
📖 [配置](https://docs.gofiber.io/fiber#config)
|
||||
📖 [配置](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [模版引擎](https://github.com/gofiber/template)
|
||||
📖 [渲染](https://docs.gofiber.io/context#render)
|
||||
📖 [渲染](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
如果未设置模版引擎,则`Fiber`默认使用[html/template](https://golang.org/pkg/html/template/)。
|
||||
|
||||
|
@ -278,7 +278,7 @@ func main() {
|
|||
|
||||
### 组合路由链
|
||||
|
||||
📖 [路由分组](https://docs.gofiber.io/application#group)
|
||||
📖 [路由分组](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -313,7 +313,7 @@ func main() {
|
|||
|
||||
### 日志中间件
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -338,7 +338,7 @@ func main() {
|
|||
|
||||
### 跨域资源共享(CORS)中间件
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -367,7 +367,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### 自定义 404 响应
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -459,7 +459,7 @@ func main() {
|
|||
|
||||
### 恢复(panic)中间件
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
|
@ -174,7 +174,7 @@ func main() {
|
|||
msg := fmt.Sprintf("👴 %s is %s years old", c.Params("name"), c.Params("age"))
|
||||
return c.SendString(msg) // => 👴 john is 75 years old
|
||||
})
|
||||
|
||||
|
||||
// GET /john
|
||||
app.Get("/:name", func(c *fiber.Ctx) error {
|
||||
msg := fmt.Sprintf("Hello, %s 👋!", c.Params("name"))
|
||||
|
@ -242,9 +242,9 @@ func main() {
|
|||
|
||||
### 界面引擎
|
||||
|
||||
📖 [設定](https://docs.gofiber.io/fiber#config)
|
||||
📖 [設定](https://docs.gofiber.io/api/fiber#config)
|
||||
📖 [引擎](https://github.com/gofiber/template)
|
||||
📖 [渲染](https://docs.gofiber.io/context#render)
|
||||
📖 [渲染](https://docs.gofiber.io/api/ctx#render)
|
||||
|
||||
當不指定樣板引擎時 Fiber 預設用[html/template](https://golang.org/pkg/html/template/)。
|
||||
|
||||
|
@ -279,7 +279,7 @@ func main() {
|
|||
|
||||
### Grouping routes into chains
|
||||
|
||||
📖 [Group](https://docs.gofiber.io/application#group)
|
||||
📖 [Group](https://docs.gofiber.io/api/app#group)
|
||||
|
||||
```go
|
||||
func middleware(c *fiber.Ctx) error {
|
||||
|
@ -314,7 +314,7 @@ func main() {
|
|||
|
||||
### 中介器 logger
|
||||
|
||||
📖 [Logger](https://docs.gofiber.io/middleware/logger)
|
||||
📖 [Logger](https://docs.gofiber.io/api/middleware/logger)
|
||||
|
||||
```go
|
||||
package main
|
||||
|
@ -339,7 +339,7 @@ func main() {
|
|||
|
||||
### 跨網域資源共享 (CORS)
|
||||
|
||||
📖 [CORS](https://docs.gofiber.io/middleware/cors)
|
||||
📖 [CORS](https://docs.gofiber.io/api/middleware/cors)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
@ -368,7 +368,7 @@ curl -H "Origin: http://example.com" --verbose http://localhost:3000
|
|||
|
||||
### 客制 404 回應
|
||||
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/application#http-methods)
|
||||
📖 [HTTP Methods](https://docs.gofiber.io/api/ctx#status)
|
||||
|
||||
```go
|
||||
func main() {
|
||||
|
@ -460,7 +460,7 @@ func main() {
|
|||
|
||||
### Recover 中介器
|
||||
|
||||
📖 [Recover](https://docs.gofiber.io/middleware/recover)
|
||||
📖 [Recover](https://docs.gofiber.io/api/middleware/recover)
|
||||
|
||||
```go
|
||||
import (
|
||||
|
|
Loading…
Reference in New Issue