From b771e45f61f5108d6736af3992c9390b523634ad Mon Sep 17 00:00:00 2001 From: Fenny Date: Fri, 14 Feb 2020 02:05:39 +0100 Subject: [PATCH] Update links, supporters & add collaps --- .github/README.md | 191 ++++++++++++++++++++++------------------ .github/README_de.md | 49 +++++++++-- .github/README_es.md | 49 +++++++++-- .github/README_ja.md | 47 ++++++++-- .github/README_ko.md | 49 +++++++++-- .github/README_pt.md | 49 +++++++++-- .github/README_ru.md | 49 +++++++++-- .github/README_zh-CN.md | 168 +++++++++++++++++++++++------------ 8 files changed, 469 insertions(+), 182 deletions(-) diff --git a/.github/README.md b/.github/README.md index dcfc1aca..d50c4803 100644 --- a/.github/README.md +++ b/.github/README.md @@ -3,7 +3,7 @@ Fiber

- @@ -136,121 +136,136 @@ func main() { ### Routing -```go -func main() { - app := fiber.New() +
+ 📜 Show code snippet + ```go + func main() { + app := fiber.New() - // GET /john - app.Get("/:name", func(c *fiber.Ctx) { - fmt.Printf("Hello %s!", c.Params("name")) - // => Hello john! - }) + // GET /john + app.Get("/:name", func(c *fiber.Ctx) { + fmt.Printf("Hello %s!", c.Params("name")) + // => Hello john! + }) - // GET /john - app.Get("/:name/:age?", func(c *fiber.Ctx) { - fmt.Printf("Name: %s, Age: %s", c.Params("name"), c.Params("age")) - // => Name: john, Age: - }) + // GET /john + app.Get("/:name/:age?", func(c *fiber.Ctx) { + fmt.Printf("Name: %s, Age: %s", c.Params("name"), c.Params("age")) + // => Name: john, Age: + }) - // GET /api/register - app.Get("/api*", func(c *fiber.Ctx) { - fmt.Printf("/api%s", c.Params("*")) - // => /api/register - }) + // GET /api/register + app.Get("/api*", func(c *fiber.Ctx) { + fmt.Printf("/api%s", c.Params("*")) + // => /api/register + }) - app.Listen(3000) -} -``` + app.Listen(3000) + } + ``` + ### Middleware -```go -func main() { - app := fiber.New() +
+ 📜 Show code snippet + ```go + func main() { + app := fiber.New() - // Match any post route - app.Post(func(c *fiber.Ctx) { - user, pass, ok := c.BasicAuth() - if !ok || user != "john" || pass != "doe" { - c.Status(403).Send("Sorry John") - return - } - c.Next() - }) + // Match any post route + app.Post(func(c *fiber.Ctx) { + user, pass, ok := c.BasicAuth() + if !ok || user != "john" || pass != "doe" { + c.Status(403).Send("Sorry John") + return + } + c.Next() + }) - // Match all routes starting with /api - app.Use("/api", func(c *fiber.Ctx) { - c.Set("Access-Control-Allow-Origin", "*") - c.Set("Access-Control-Allow-Headers", "X-Requested-With") - c.Next() - }) + // Match all routes starting with /api + app.Use("/api", func(c *fiber.Ctx) { + c.Set("Access-Control-Allow-Origin", "*") + c.Set("Access-Control-Allow-Headers", "X-Requested-With") + c.Next() + }) - // Optional param - app.Post("/api/register", func(c *fiber.Ctx) { - username := c.Body("username") - password := c.Body("password") - // .. - }) + // Optional param + app.Post("/api/register", func(c *fiber.Ctx) { + username := c.Body("username") + password := c.Body("password") + // .. + }) - app.Listen(3000) -} -``` + app.Listen(3000) + } + ``` + ### 404 Handling -```go -func main() { - app := fiber.New() +
+ 📜 Show code snippet + ```go + func main() { + app := fiber.New() - // Serve static files from "public" directory - app.Static("./public") + // Serve static files from "public" directory + app.Static("./public") - // Last middleware - app.Use(func(c *fiber.Ctx) { - c.SendStatus(404) // => 404 "Not Found" - }) + // Last middleware + app.Use(func(c *fiber.Ctx) { + c.SendStatus(404) // => 404 "Not Found" + }) - app.Listen(3000) -} -``` + app.Listen(3000) + } + ``` + ### JSON Response -```go -func main() { - app := fiber.New() +
+ 📜 Show code snippet + ```go + func main() { + app := fiber.New() - type User struct { - Name string `json:"name"` - Age int `json:"age"` + type User struct { + Name string `json:"name"` + Age int `json:"age"` + } + + // Serialize JSON + app.Get("/json", func(c *fiber.Ctx) { + c.JSON(&User{"John", 20}) + }) + + app.Listen(3000) } - - // Serialize JSON - app.Get("/json", func(c *fiber.Ctx) { - c.JSON(&User{"John", 20}) - }) - - app.Listen(3000) -} -``` + ``` + ### Recover -```go -func main() { - app := fiber.New() +
+ 📜 Show code snippet + ```go + func main() { + app := fiber.New() - app.Get("/json", func(c *fiber.Ctx) { - panic("Something went wrong!") - }) + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) - app.Recover(func(c *fiber.Ctx) { - c.Status(500).Send(c.Error()) - }) + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) - app.Listen(3000) -} -``` + app.Listen(3000) + } + ``` +
## 💬 Media diff --git a/.github/README_de.md b/.github/README_de.md index b558c9e0..f210da0c 100644 --- a/.github/README_de.md +++ b/.github/README_de.md @@ -3,7 +3,7 @@ Fiber


- + @@ -231,6 +231,24 @@ func main() { } ``` +### Recover + +```go +func main() { + app := fiber.New() + + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) + + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) + + app.Listen(3000) +} +``` + ## 💬 Medien - [Welcome to Fiber — an Express.js styled web framework written in Go with ❤️](https://dev.to/koddr/welcome-to-fiber-an-express-js-styled-fastest-web-framework-written-with-on-golang-497) _von [Vic Shóstak](https://github.com/koddr), 03 Feb 2020_ @@ -244,18 +262,35 @@ Falls du **danke** sagen möchtest und/oder aktiv die Entwicklung von `fiber` f 3. Schreibe eine Rezension auf [Medium](https://medium.com/), [Dev.to](https://dev.to/) oder einem persönlichem Blog. 4. Hilf uns diese `README` und die [API Docs](https://fiber.wiki/) in eine andere Sprache zu übersetzen. -Buy Me A Coffee - ## ☕ Supporters +Buy Me A Coffee + + + +
- -
- ToishY +
+
+ HenrikBinggl
-
+ +
+ koddr +
+
+ +
+ MarvinJWendt +
+
+ +
+ ToishY +
+
diff --git a/.github/README_es.md b/.github/README_es.md index e2682568..02bebac4 100644 --- a/.github/README_es.md +++ b/.github/README_es.md @@ -3,7 +3,7 @@ Fiber

- + @@ -230,6 +230,24 @@ func main() { } ``` +### Recover + +```go +func main() { + app := fiber.New() + + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) + + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) + + app.Listen(3000) +} +``` + ## 💬 Medios - [Bienvenido a Fiber: un marco web con estilo Express.js escrito en Go with ❤️](https://dev.to/koddr/welcome-to-fiber-an-express-js-styled-fastest-web-framework-written-with-on-golang-497) *por [Vic Shóstak](https://github.com/koddr), 03 feb 2020* @@ -243,18 +261,35 @@ Si quiere **agradecer** y/o apoyar el desarrollo activo de la `Fiber`: 3. Escriba una reseña o tutorial en [Medium](https://medium.com/) , [Dev.to](https://dev.to/) o blog personal. 4. Ayúdanos a traducir este `README` y [API Docs](https://fiber.wiki/) a otro idioma. -Buy Me A Coffee - ## ☕ Supporters +Buy Me A Coffee + + + +
- -
- ToishY +
+
+ HenrikBinggl
-
+ +
+ koddr +
+
+ +
+ MarvinJWendt +
+
+ +
+ ToishY +
+
diff --git a/.github/README_ja.md b/.github/README_ja.md index 364c0eff..987750d3 100644 --- a/.github/README_ja.md +++ b/.github/README_ja.md @@ -3,7 +3,7 @@ Fiber

- + @@ -230,6 +230,24 @@ func main() { } ``` +### Recover + +```go +func main() { + app := fiber.New() + + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) + + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) + + app.Listen(3000) +} +``` + ## 💬 メディア - [ファイバーへようこそ— Go with❤️で記述されたExpress.jsスタイルのWebフレームワーク](https://dev.to/koddr/welcome-to-fiber-an-express-js-styled-fastest-web-framework-written-with-on-golang-497) *[ヴィック・ショースタク](https://github.com/koddr) 、2020年2月3日* @@ -247,14 +265,33 @@ func main() { ## ☕ Supporters +Buy Me A Coffee + + + +
- -
- ToishY +
+
+ HenrikBinggl
-
+ +
+ koddr +
+
+ +
+ MarvinJWendt +
+
+ +
+ ToishY +
+
diff --git a/.github/README_ko.md b/.github/README_ko.md index 3c6cebcf..98c10189 100644 --- a/.github/README_ko.md +++ b/.github/README_ko.md @@ -3,7 +3,7 @@ Fiber

- + @@ -231,6 +231,24 @@ func main() { } ``` +### Recover + +```go +func main() { + app := fiber.New() + + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) + + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) + + app.Listen(3000) +} +``` + ## 💬 미디어 - [Welcome to Fiber — an Express.js styled web framework written in Go with ❤️](https://dev.to/koddr/welcome-to-fiber-an-express-js-styled-fastest-web-framework-written-with-on-golang-497) _by [Vic Shóstak](https://github.com/koddr), 03 Feb 2020_ @@ -244,18 +262,35 @@ func main() { 3. [Medium](https://medium.com/), [Dev.to](https://dev.to/) 또는 개인 블로그에 리뷰 또는 튜토리얼을 작성하세요. 4. `README` 와 [API 문서](https://fiber.wiki/)를 다른 언어로 번역하는 것을 도와주세요. -Buy Me A Coffee - ## ☕ Supporters +Buy Me A Coffee + + + +
- -
- ToishY +
+
+ HenrikBinggl
-
+ +
+ koddr +
+
+ +
+ MarvinJWendt +
+
+ +
+ ToishY +
+
diff --git a/.github/README_pt.md b/.github/README_pt.md index 034bf12e..0e5d1942 100644 --- a/.github/README_pt.md +++ b/.github/README_pt.md @@ -3,7 +3,7 @@ Fiber

- + @@ -231,6 +231,24 @@ func main() { } ``` +### Recover + +```go +func main() { + app := fiber.New() + + app.Get("/json", func(c *fiber.Ctx) { + panic("Something went wrong!") + }) + + app.Recover(func(c *fiber.Ctx) { + c.Status(500).Send(c.Error()) + }) + + app.Listen(3000) +} +``` + ## 💬 Mídia - [Bem-vindo ao Fiber — uma estrutura da Web com estilo Express.js, escrita em Go com ❤️](https://dev.to/koddr/welcome-to-fiber-an-express-js-styled-fastest-web-framework-written-with-on-golang-497) _por [Vic Shóstak](https://github.com/koddr), 03 fev 2020_ @@ -244,18 +262,35 @@ Se você quer **agradecer** e/ou apoiar o desenvolvimento ativo do `Fiber`: 3. Escreva um review ou tutorial no [Medium](https://medium.com/), [Dev.to](https://dev.to/) ou blog pessoal. 4. Nos ajude a traduzir esses `README` e a [documentação da API](https://fiber.wiki/) para outros idiomas. -Buy Me A Coffee - ## ☕ Supporters +Buy Me A Coffee + + + +
- -
- ToishY +
+
+ HenrikBinggl
-
+ +
+ koddr +
+
+ +
+ MarvinJWendt +
+
+ +
+ ToishY +
+
diff --git a/.github/README_ru.md b/.github/README_ru.md index a4946721..c55fe38d 100644 --- a/.github/README_ru.md +++ b/.github/README_ru.md @@ -3,7 +3,7 @@ Fiber

- +