From 563907cacb8c0f8b8191800079ee35cc305025eb Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Wed, 1 Jul 2020 10:44:15 +0200 Subject: [PATCH] Update examples --- .github/README.md | 54 +++++++++++++++++------------------ .github/README_ar_SA.md | 54 +++++++++++++++++------------------ .github/README_de.md | 54 +++++++++++++++++------------------ .github/README_es.md | 54 +++++++++++++++++------------------ .github/README_fr.md | 54 +++++++++++++++++------------------ .github/README_he.md | 54 +++++++++++++++++------------------ .github/README_id.md | 54 +++++++++++++++++------------------ .github/README_ja.md | 54 +++++++++++++++++------------------ .github/README_ko.md | 54 +++++++++++++++++------------------ .github/README_nl.md | 54 +++++++++++++++++------------------ .github/README_pt.md | 54 +++++++++++++++++------------------ .github/README_ru.md | 54 +++++++++++++++++------------------ .github/README_tr.md | 54 +++++++++++++++++------------------ .github/README_zh-CN.md | 54 +++++++++++++++++------------------ .github/README_zh-TW.md | 54 +++++++++++++++++------------------ middleware/filesystem.md | 0 middleware/filesystem_test.go | 1 + 17 files changed, 406 insertions(+), 405 deletions(-) create mode 100644 middleware/filesystem.md create mode 100644 middleware/filesystem_test.go diff --git a/.github/README.md b/.github/README.md index 7e69bef3..89f883c8 100644 --- a/.github/README.md +++ b/.github/README.md @@ -144,39 +144,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_ar_SA.md b/.github/README_ar_SA.md index a91d3c49..b5115699 100644 --- a/.github/README_ar_SA.md +++ b/.github/README_ar_SA.md @@ -162,39 +162,39 @@ Fiber Ω‡Ωˆ **Ω…Ψ³ΨͺΩˆΨ­Ω‰** Ω…Ω† Express, Ψ₯Ψ·Ψ§Ψ± Ψ§Ω„ΩˆΩŠΨ¨ Ψ§Ω„Ψ£ΩƒΨ«Ψ± Ψ΄ΨΉ ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_de.md b/.github/README_de.md index 128741cf..c7dd99b1 100644 --- a/.github/README_de.md +++ b/.github/README_de.md @@ -144,39 +144,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_es.md b/.github/README_es.md index 45e5bc08..08c35a68 100644 --- a/.github/README_es.md +++ b/.github/README_es.md @@ -144,39 +144,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_fr.md b/.github/README_fr.md index fd6fd14f..3af483ab 100644 --- a/.github/README_fr.md +++ b/.github/README_fr.md @@ -144,39 +144,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_he.md b/.github/README_he.md index d7c92b50..d37e694e 100644 --- a/.github/README_he.md +++ b/.github/README_he.md @@ -195,39 +195,39 @@ Fiber Χ Χ•Χ¦Χ¨Χ” **בהשראΧͺ** Express, Χ”-web framework Χ”Χ€Χ•Χ€Χ•ΧœΧ¨Χ™Χͺ ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_id.md b/.github/README_id.md index ef045c1f..69d75826 100644 --- a/.github/README_id.md +++ b/.github/README_id.md @@ -146,39 +146,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_ja.md b/.github/README_ja.md index 9c18485d..dcd6a991 100644 --- a/.github/README_ja.md +++ b/.github/README_ja.md @@ -147,39 +147,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_ko.md b/.github/README_ko.md index 734273eb..b5d53744 100644 --- a/.github/README_ko.md +++ b/.github/README_ko.md @@ -149,39 +149,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_nl.md b/.github/README_nl.md index d8ce8d45..055e14ce 100644 --- a/.github/README_nl.md +++ b/.github/README_nl.md @@ -148,39 +148,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_pt.md b/.github/README_pt.md index 18e87580..6ce43454 100644 --- a/.github/README_pt.md +++ b/.github/README_pt.md @@ -144,39 +144,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_ru.md b/.github/README_ru.md index 081af75a..2be49725 100644 --- a/.github/README_ru.md +++ b/.github/README_ru.md @@ -146,39 +146,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_tr.md b/.github/README_tr.md index fbcaf637..82f9a933 100644 --- a/.github/README_tr.md +++ b/.github/README_tr.md @@ -142,39 +142,39 @@ Aşağıda yaygΔ±n ΓΆrneklerden bazΔ±larΔ± listelenmiştir. Daha fazla kod ΓΆrne ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_zh-CN.md b/.github/README_zh-CN.md index d9a90c7e..0604b201 100644 --- a/.github/README_zh-CN.md +++ b/.github/README_zh-CN.md @@ -147,39 +147,39 @@ Listed below are some of the common examples. If you want to see more code examp ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/.github/README_zh-TW.md b/.github/README_zh-TW.md index b75f5b39..5bd3323e 100644 --- a/.github/README_zh-TW.md +++ b/.github/README_zh-TW.md @@ -146,39 +146,39 @@ Fiber **ε—εˆ°** ηΆ²θ·―δΈŠζœ€ζ΅θ‘Œηš„Webζ‘†ζžΆExpressJS**ε•Ÿη™Ό**,硐合Expre ```go func main() { - app := fiber.New() + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) - c.Send(msg) // => Hello john πŸ‘‹! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + msg := fmt.Sprintf("Hello, %s πŸ‘‹!", c.Params("name")) + c.Send(msg) // => Hello john πŸ‘‹! + }) - // GET /john/75 - app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) - c.Send(msg) // => πŸ‘΄ john is 75 years old - }) + // GET /john/75 + app.Get("/:name/:age/:gender?", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ‘΄ %s is %s years old", c.Params("name"), c.Params("age")) + c.Send(msg) // => πŸ‘΄ john is 75 years old + }) - // GET /dictionary.txt - app.Get("/:file.:ext", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) - c.Send(msg) // => πŸ“ƒ dictionary.txt - }) + // GET /dictionary.txt + app.Get("/:file.:ext", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ“ƒ %s.%s", c.Params("file"), c.Params("ext")) + c.Send(msg) // => πŸ“ƒ dictionary.txt + }) - // GET /flights/LAX-SFO - app.Get("/flights/:from-:to", func(c *fiber.Ctx) { - msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) - c.Send(msg) // => πŸ’Έ From: LAX, To: SFO - }) + // GET /flights/LAX-SFO + app.Get("/flights/:from-:to", func(c *fiber.Ctx) { + msg := fmt.Sprintf("πŸ’Έ From: %s, To: %s", c.Params("from"), c.Params("to")) + c.Send(msg) // => πŸ’Έ From: LAX, To: SFO + }) - // GET /api/register - app.Get("/api/*", func(c *fiber.Ctx) { - msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) - c.Send(msg) // => βœ‹ /api/register - }) + // GET /api/register + app.Get("/api/*", func(c *fiber.Ctx) { + msg := fmt.Sprintf("βœ‹ %s", c.Params("*")) + c.Send(msg) // => βœ‹ /api/register + }) - app.Listen(3000) + app.Listen(3000) } ``` diff --git a/middleware/filesystem.md b/middleware/filesystem.md new file mode 100644 index 00000000..e69de29b diff --git a/middleware/filesystem_test.go b/middleware/filesystem_test.go new file mode 100644 index 00000000..c870d7c1 --- /dev/null +++ b/middleware/filesystem_test.go @@ -0,0 +1 @@ +package middleware