nio

Modern, minimal and productive Go HTTP framework

  • Owner: go-nio/nio
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownergo-nio/nio
Primary LanguageGo
Program languageHTML (Language Count: 2)
Platform
License:MIT License
所有者活动
Created At2018-12-04 18:45:47
Pushed At2019-08-10 08:37:50
Last Commit At2019-08-10 11:37:49
Release Count10
Last Release Namev1.0.2 (Posted on 2019-01-13 14:50:40)
First Release Namev0.0.1 (Posted on 2018-12-15 20:35:34)
用户参与
Stargazers Count23
Watchers Count3
Fork Count2
Commits Count66
Has Issues Enabled
Issues Count7
Issue Open Count0
Pull Requests Count9
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private