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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?