Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 766 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 766 Bytes

Nue - 鵺

Nue is a lightweight high performance HTTP request router for Golang.

Build status

wercker status

Installation

$ go get github.com/gotokatsuya/nue

Usage

package main

import (
	"net/http"
	
	"github.com/gotokatsuya/nue"
)

func main() {
	handler := nue.New()
	handler.AddHandler("/hello", "/world", func(rw http.ResponseWriter, r *http.Request) {
		rw.Write([]byte("hello world"))
	})
	handler.AddNotFoundHandler(func(rw http.ResponseWriter, r *http.Request) {
		rw.Write([]byte("Not found route."))
	})
	http.ListenAndServe(":8080", handler)
}