Skip to content

Commit

Permalink
Merge pull request #2 from gofiber/master
Browse files Browse the repository at this point in the history
Update fork from source
  • Loading branch information
koddr committed Feb 5, 2020
2 parents 99d1d59 + 0e94091 commit 1cb717a
Show file tree
Hide file tree
Showing 60 changed files with 762 additions and 2,310 deletions.
40 changes: 12 additions & 28 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
---
name: Bug report
about: Create a report to help us improve
title: "[🐞] "
labels: ""
title: "🐞 "
labels: bug
assignees: ""
---
**Fiber version/commit**

☝️ **Don't forget to add title above!** ☝️
**Issue description**

**Your environment:**
**Expected behavior**

- Fiber Web Framework [e.g. `1.2.3`]:
- OS [e.g. `macOS 10.14.6`]:
- Golang [e.g. `1.13.7`]:
**Steps to reproduce**

## Describe the bug
**Code snippet**

A clear and concise description of what the bug is.
```go
package main

## To reproduce
func main() {

Steps to reproduce the behavior:

1. Create func '...'
2. Run '...'
3. ...
4. See error

## Expected behavior

A clear and concise description of what you expected to happen.

### Screenshots

If applicable, add screenshots to help explain your problem.

### Additional context

Add any other context about the problem here.
}
```
12 changes: 3 additions & 9 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[🔥] "
labels: ""
title: "🔥 "
labels: enhancement
assignees: ""
---

☝️ **Don't forget to add title above!** ☝️

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Is your feature request related to a problem?**

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Question
about: Ask a question so we can help
title: "🤔 "
labels: question
assignees: ""
---
**Question description**

**Code snippet (optional)**

```go
package main

func main() {

}
```
2 changes: 1 addition & 1 deletion .github/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ newPRWelcomeComment: >
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
Congrats on merging your first pull request! 🎉 We here at behaviorbot are proud of you!
Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you!
28 changes: 28 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Go
on: [push]
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
- name: Build
run: go build -v .
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: go
go:
- 1.13.x
env:
- GO111MODULE=on
install:
- go get -v golang.org/x/lint/golint
script:
# - golint -set_exit_status ./...
- go test -race ./...
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
# 🔌 Fiber Web Framework
# 🚀 Fiber <a href="README_RU.md"><img width="20px" src="docs/static/flags/ru.svg" alt="ru"/></a> <a href="README_CH.md"><img width="20px" src="docs/static/flags/ch.svg" alt="ch"/></a>

[![](https://img.shields.io/github/release/gofiber/fiber)](https://github.com/gofiber/fiber/releases) ![](https://img.shields.io/github/languages/top/gofiber/fiber) [![](https://godoc.org/github.com/gofiber/fiber?status.svg)](https://godoc.org/github.com/gofiber/fiber) ![](https://goreportcard.com/badge/github.com/gofiber/fiber) [![GitHub license](https://img.shields.io/github/license/gofiber/fiber.svg)](https://github.com/gofiber/fiber/blob/master/LICENSE) [![Join the chat at https://gitter.im/FiberGo/community](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FiberGo/community)
[![](https://img.shields.io/github/release/gofiber/fiber)](https://github.com/gofiber/fiber/releases) ![](https://img.shields.io/github/languages/top/gofiber/fiber) [![](https://godoc.org/github.com/gofiber/fiber?status.svg)](https://godoc.org/github.com/gofiber/fiber) ![](https://goreportcard.com/badge/github.com/gofiber/fiber) [![GitHub license](https://img.shields.io/github/license/gofiber/fiber.svg)](https://github.com/gofiber/fiber/blob/master/LICENSE) [![Join the chat at https://gitter.im/gofiber/community](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gofiber/community)

<img align="right" height="180px" src="docs/static/logo_320px_trans.png" alt="Fiber logo" />

**[Fiber](https://github.com/gofiber/fiber)** is an [Express.js](https://expressjs.com/en/4x/api.html) styled HTTP web framework implementation running on [Fasthttp](https://github.com/valyala/fasthttp), the **fastest** HTTP engine for Go (Golang). The package make use of **similar framework convention** as they are in Express.

People switching from [Node.js](https://nodejs.org/en/about/) to [Go](https://golang.org/doc/) often end up in a bad learning curve to start building their webapps, this project is meant to **ease** things up for **fast** development, but with **zero memory allocation** and **performance** in mind.

**In other languages:** <a href="README_RU.md"><img width="20px" src="docs/static/flags/ru.svg" alt="ru"/></a> <a href="README_CH.md"><img width="20px" src="docs/static/flags/ch.svg" alt="ch"/></a>

## API Documentation

📚 We created an extended **API documentation** (_including examples_), **[click here](https://gofiber.github.io/fiber/)**.
📚 We created an extended **API documentation** (_including examples_), **[Visit fiber.wiki](https://fiber.wiki/)**.

## Benchmark

[![](https://gofiber.github.io/fiber/static/benchmarks/benchmark.png)](https://gofiber.github.io/fiber/#/benchmarks)
[![](https://fiber.wiki/static/benchmarks/benchmark.png)](https://fiber.wiki/#/benchmarks)

👉 **[Click here](https://gofiber.github.io/fiber/#/benchmarks)** to see all benchmark results.
👉 **[Click here](https://fiber.wiki/#/benchmarks)** to see all benchmark results.

## Features

Expand All @@ -28,7 +26,7 @@ People switching from [Node.js](https://nodejs.org/en/about/) to [Go](https://go
- Static files with custom prefix
- Middleware with Next support
- Express API endpoints
- [Extended documentation](https://gofiber.github.io/fiber/)
- [Extended documentation](https://fiber.wiki/)

## Installing

Expand Down Expand Up @@ -75,7 +73,7 @@ And now, browse to `http://localhost:8080` and you should see `Hello, World!` on

## Static files

To serve static files, use the [Static](https://gofiber.github.io/fiber/#/?id=static-files) method:
To serve static files, use the [Static](https://fiber.wiki/#/?id=static-files) method:

```go
package main
Expand Down Expand Up @@ -138,17 +136,17 @@ func main() {

## Project assistance

If you want to say «thank you» or/and support active development `gofiber/fiber`:
If you want to say **thank you** or/and support active development `gofiber/fiber`:

1. Add a GitHub Star to project.
2. Twit about project [on your Twitter](https://twitter.com/intent/tweet?text=%F0%9F%94%8C%20Fiber%20is%20an%20Express.js%20inspired%20Go%20web%20framework%20build%20on%20%F0%9F%9A%80%20Fasthttp%20https%3A%2F%2Fgithub.com%2Fgofiber%2Ffiber).
3. Help us to translate this `README` and [API Docs](https://gofiber.github.io/fiber/) to another language.
2. Tweet about project [on your Twitter](https://twitter.com/intent/tweet?text=%F0%9F%94%8C%20Fiber%20is%20an%20Express.js%20inspired%20Go%20web%20framework%20build%20on%20%F0%9F%9A%80%20Fasthttp%20https%3A%2F%2Fgithub.com%2Fgofiber%2Ffiber).
3. Help us to translate this `README` and [API Docs](https://fiber.wiki/) to another language.

Thanks for your support! 😘 Together, we make `Fiber Web Framework` better every day.
Thanks for your support! 😘 Together, we make `Fiber`.

## Stargazers over time
## Stars over time

[![Stargazers over time](https://starchart.cc/gofiber/fiber.svg)](https://starchart.cc/gofiber/fiber)
<a href="https://starchart.cc/gofiber/fiber" rel="nofollow"><img src="https://starchart.cc/gofiber/fiber.svg" alt="Stars over time" style="max-width:100%;"></a>

## License

Expand Down
150 changes: 146 additions & 4 deletions README_CH.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,153 @@
# 🔌 Fiber Web Framework
# 🚀 Fiber <a href="README.md"><img width="20px" src="docs/static/flags/en.svg" alt="en"/></a> <a href="README_RU.md"><img width="20px" src="docs/static/flags/ru.svg" alt="ru"/></a>

[![](https://img.shields.io/github/release/gofiber/fiber)](https://github.com/gofiber/fiber/releases) ![](https://img.shields.io/github/languages/top/gofiber/fiber) [![](https://godoc.org/github.com/gofiber/fiber?status.svg)](https://godoc.org/github.com/gofiber/fiber) ![](https://goreportcard.com/badge/github.com/gofiber/fiber) [![GitHub license](https://img.shields.io/github/license/gofiber/fiber.svg)](https://github.com/gofiber/fiber/blob/master/LICENSE) [![Join the chat at https://gitter.im/FiberGo/community](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/FiberGo/community)
[![](https://img.shields.io/github/release/gofiber/fiber)](https://github.com/gofiber/fiber/releases) ![](https://img.shields.io/github/languages/top/gofiber/fiber) [![](https://godoc.org/github.com/gofiber/fiber?status.svg)](https://godoc.org/github.com/gofiber/fiber) ![](https://goreportcard.com/badge/github.com/gofiber/fiber) [![GitHub license](https://img.shields.io/github/license/gofiber/fiber.svg)](https://github.com/gofiber/fiber/blob/master/LICENSE) [![Join the chat at https://gitter.im/gofiber/community](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/gofiber/community)

<img align="right" height="180px" src="docs/static/logo_320px_trans.png" alt="Fiber logo" />

Help us to translate [this README](https://github.com/gofiber/fiber/blob/master/README_CH.md) in chinese.
**[Fiber](https://github.com/gofiber/fiber)** 是一个 [Express.js](https://expressjs.com/en/4x/api.html) 运行的样式化HTTP Web框架实现 [Fasthttp](https://github.com/valyala/fasthttp), **最快的** HTTP引擎 Go (Golang). 该软件包使用了**相似的框架约定** Express.

人们从 [Node.js](https://nodejs.org/en/about/)[Go](https://golang.org/doc/) 通常会遇到学习曲线不好的问题,从而开始构建他们的Web应用程序, 这个项目是为了 **缓解** 事情准备 **快速** 发展,但与 **零内存分配****性能** 心里.

## API Documentation

📚 我们创建了一个扩展我们创建了一个扩展 **API documentation** (_包括例子_), **[点击这里](https://fiber.wiki/)**.

## Benchmark

[![](https://fiber.wiki/static/benchmarks/benchmark.png)](https://fiber.wiki/#/benchmarks)

👉 **[点击这里](https://fiber.wiki/#/benchmarks)** 查看所有基准测试结果.

## Features

- 针对速度和低内存使用进行了优化
- 快速的服务器端编程
- 通过参数轻松路由
- 具有自定义前缀的静态文件
- 具有Next支持的中间件
- Express API端点
- [Extended documentation](https://fiber.wiki/)

## Installing

假设您已经安装 Go `1.11+` 😉

安装 [Fiber](https://github.com/gofiber/fiber) 通过调用以下命令来打包:

```bash
go get -u github.com/gofiber/fiber
```

## Hello, world!

本质上,下面嵌入是您可以创建的最简单的Fiber应用程序:

```go
// server.go

package main

import "github.com/gofiber/fiber"

func main() {
// Create new Fiber instance
app := fiber.New()

// Create new route with GET method
app.Get("/", func(c *fiber.Ctx) {
c.Send("Hello, World!")
})

// Start server on http://localhost:8080
app.Listen(8080)
}
```

转到控制台并运行:

```bash
go run server.go
```

现在,浏览至 `http://localhost:8080` 你应该看到 `Hello, World!` 在页面上! 🎉

## Static files

要提供静态文件,请使用 [Static](https://fiber.wiki/#/?id=static-files) 方法:

```go
package main

import "github.com/gofiber/fiber"

func main() {
// Create new Fiber instance
app := fiber.New()

// Serve all static files on ./public folder
app.Static("./public")

// Start server on http://localhost:8080
app.Listen(8080)
}
```

现在,您可以加载公共目录中的文件:

```bash
http://localhost:8080/hello.html
http://localhost:8080/js/script.js
http://localhost:8080/css/style.css
```

## Middleware

中间件从未如此简单!就像Express,您致电 `Next()` 匹配路线功能:

```go
package main

import "github.com/gofiber/fiber"

func main() {
// Create new Fiber instance
app := fiber.New()

// Define all used middlewares in Use()

app.Use(func(c *fiber.Ctx) {
c.Write("Match anything!\n")
c.Next()
})

app.Use("/api", func(c *fiber.Ctx) {
c.Write("Match starting with /api\n")
c.Next()
})

app.Get("/api/user", func(c *fiber.Ctx) {
c.Write("Match exact path /api/user\n")
})

// Start server on http://localhost:8080
app.Listen(8080)
}
```

## Project assistance

如果您要说声谢谢或/并且支持积极的发展 `gofiber/fiber`:

1. 将GitHub Star添加到项目中。
2. 关于项目的推文 [on your Twitter](https://twitter.com/intent/tweet?text=%F0%9F%94%8C%20Fiber%20is%20an%20Express.js%20inspired%20Go%20web%20framework%20build%20on%20%F0%9F%9A%80%20Fasthttp%20https%3A%2F%2Fgithub.com%2Fgofiber%2Ffiber).
3. 帮助我们翻译 `README`[API Docs](https://fiber.wiki/) 换一种语言.

谢谢你的支持! 😘 我们在一起 `Fiber Web Framework` 每天都好.

## Stargazers over time

[![Stargazers over time](https://starchart.cc/gofiber/fiber.svg)](https://starchart.cc/gofiber/fiber)

## License

⚠️ _Please note:_ `gofiber/fiber` is free and open-source software licensed under the [MIT License](https://github.com/gofiber/fiber/edit/master/LICENSE).
⚠️ _请注意:_ `gofiber/fiber` 是根据以下条款获得许可的免费开源软件 [MIT License](https://github.com/gofiber/fiber/edit/master/LICENSE).

0 comments on commit 1cb717a

Please sign in to comment.