Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 1.1 KB

README.md

File metadata and controls

22 lines (15 loc) · 1.1 KB

Scaffold

Simple context aware router

GoDoc Coverage Status Build Status Go Report Card

Scaffold is a simple router with middleware support. It allows for alternate dispatchers.

The default dispatcher can parse basic patterns in the form /segment/:param/segment. Parameters can be accessed in the Handler/Middleware using GetParam.

Example:

dispatcher := scaffold.DefaultDispatcher()
router := scaffold.New(dispatcher)

// More specific routes have precedence
router.Host("example.com").Get("", somehandler)
router.Get("", somehandler)

http.ListenAndServe(":8080", dispatcher)