Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razonyang/fastrouter
FastRouter is a fast, flexible HTTP router written in Go.
https://github.com/razonyang/fastrouter
fast go golang grouping http middleware router
Last synced: 2 months ago
JSON representation
FastRouter is a fast, flexible HTTP router written in Go.
- Host: GitHub
- URL: https://github.com/razonyang/fastrouter
- Owner: razonyang
- License: bsd-3-clause
- Created: 2017-11-01T08:52:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-03T15:05:25.000Z (about 7 years ago)
- Last Synced: 2024-04-14T02:23:36.700Z (8 months ago)
- Topics: fast, go, golang, grouping, http, middleware, router
- Language: Go
- Size: 13.7 KB
- Stars: 23
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - fastrouter - FastRouter is a fast, flexible HTTP router written in Go. - ★ 17 (Web Frameworks)
- awesome-go-extra - fastrouter - 11-01T08:52:52Z|2017-11-03T15:05:25Z| (Web Frameworks / Routers)
README
# FastRouter
FastRouter is a fast, flexible HTTP router written in Go.
FastRouter contains some customizable options, such as `TrailingSlashesPolicy`, `PanicHandler`, `OptionsHandler`,
`MethodNotAllowedHandler`, `NotFoundHandler` and so on.FastRouter also provides some useful features, such as **grouping** and **middleware**.
[![GoDoc](https://godoc.org/github.com/razonyang/fastrouter?status.svg)](https://godoc.org/github.com/razonyang/fastrouter)
[![Build Status](https://travis-ci.org/razonyang/fastrouter.svg?branch=master)](https://travis-ci.org/razonyang/fastrouter)
[![Go Report Card](https://goreportcard.com/badge/github.com/razonyang/fastrouter)](https://goreportcard.com/report/github.com/razonyang/fastrouter)
[![Coverage Status](https://coveralls.io/repos/github/razonyang/fastrouter/badge.svg?branch=master)](https://coveralls.io/github/razonyang/fastrouter?branch=master)# Features
**Fast**: See [Go Web Framework Benchmark](https://github.com/razonyang/go-web-framework-benchmark)
**Flexible**: FastRouter provides some customizable options for you:
- TrailingSlashesPolicy:
- IgnoreTrailingSlashes: ignore trailing slashes.
- AppendTrailingSlashes: append trailing slashes and redirect if request path is not end with '/'.
- RemoveTrailingSlashes: remove trailing slashes and redirect if request path is end with '/'.
- StrictTrailingSlashes: remove or append trailing slashes according to corresponding pattern.
- PanicHandler
- OptionsHandler
- MethodNotAllowedHandler
- NotFoundHandler**Compatible**: FastRouter is an implementation of http.Handler, so it is compatible with third-party packages.
**Middleware**: Middleware is a chaining tool for chaining `http.Handler`,
see [Middleware](https://godoc.org/github.com/razonyang/fastrouter#Middleware).**Grouping**: Grouping is an useful feature of FastRouter, it allows to nest and specify middleware of group,
see [Grouping](https://godoc.org/github.com/razonyang/fastrouter#Router.Group).# Documentation
See [Documentation](https://godoc.org/github.com/razonyang/fastrouter)
for details.# Examples
- [Basic example](https://godoc.org/github.com/razonyang/fastrouter#example-package)
- [Grouping example](https://godoc.org/github.com/razonyang/fastrouter#example-Router-Group)
- [Middleware example](https://godoc.org/github.com/razonyang/fastrouter#example-Middleware)
- [Serve static files example](https://godoc.org/github.com/razonyang/fastrouter#example-Router-ServeFiles)See [Examples](https://godoc.org/github.com/razonyang/fastrouter#example-package) for details.