nio

Modern, minimal and productive Go HTTP framework

  • 所有者: go-nio/nio
  • 平台:
  • 許可證: MIT License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

Build Status
codecov
GoDoc
Go Report Card

Note

All development and improvements are moved to goroute.

Features

  • Zero external runtime dependencies
  • Smart HTTP Routing
  • Data binding for JSON, XML and form payload
  • Middlewares on global, group or single route level
  • Full control of http server

Builtin middlewares

  • Basic Auth
  • Body Dump
  • Body Limit
  • Compress (GZip)
  • CORS
  • CSRF
  • Key Auth
  • Method Override
  • Recover
  • Request ID
  • Rewrite
  • Secure
  • Slash
  • Static

Getting Started

Prerequisites

You need to have at least go 1.11 installed on you local machine.

Installing

Install nio package with go get

go get -u github.com/go-nio/nio

Start your first awesome server. Create main.go file and add:

package main

import (
    "net/http"
    "log"
    "github.com/go-nio/nio"
)

func main() {
	// Nio instance
	n := nio.New()

	// Routes
	n.GET("/", hello)

	// Start server
	log.Fatal(http.ListenAndServe(":1323", n))
}

// Handler
func hello(c nio.Context) error {
	return c.String(http.StatusOK, "Hello, World!")
}

And finally run it

go run main.go

More examples

See examples

Built With

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Andzej Maciusovic - Initial work - anjmao

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • This project is largely ispired by echo. Parts of the code are adopted from echo. See NOTICE.

主要指標

概覽
名稱與所有者go-nio/nio
主編程語言Go
編程語言HTML (語言數: 2)
平台
許可證MIT License
所有者活动
創建於2018-12-04 18:45:47
推送於2019-08-10 08:37:50
最后一次提交2019-08-10 11:37:49
發布數10
最新版本名稱v1.0.2 (發布於 2019-01-13 14:50:40)
第一版名稱v0.0.1 (發布於 2018-12-15 20:35:34)
用户参与
星數23
關注者數3
派生數2
提交數66
已啟用問題?
問題數7
打開的問題數0
拉請求數9
打開的拉請求數0
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?