Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Httprouter | 15,286 | 3,927 | 1,690 | 13 days ago | 12 | August 14, 2020 | 83 | bsd-3-clause | Go | |
A high performance HTTP request router that scales well | ||||||||||
Routing | 7,417 | 99,259 | 1,115 | 3 days ago | 531 | June 08, 2022 | mit | PHP | ||
Maps an HTTP request to a set of configuration variables | ||||||||||
Go Restful | 4,764 | 6,110 | 2,145 | 2 months ago | 96 | July 21, 2022 | 4 | mit | Go | |
package for building REST-style Web Services using Go | ||||||||||
Compojure | 4,018 | 6,265 | a month ago | 63 | April 15, 2018 | 7 | epl-1.0 | Clojure | ||
A concise routing library for Ring/Clojure | ||||||||||
Klein.php | 2,630 | 362 | 65 | 9 months ago | 9 | February 01, 2017 | 97 | mit | PHP | |
A fast & flexible router | ||||||||||
Aqueduct | 2,357 | 35 | 2 | 2 years ago | 38 | June 01, 2020 | 180 | bsd-2-clause | Dart | |
Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider. | ||||||||||
Siler | 1,126 | 19 | 8 | a year ago | 43 | January 27, 2021 | 28 | mit | ||
⚡ Flat-files and plain-old PHP functions rockin'on as a set of general purpose high-level abstractions. | ||||||||||
Awesome Micro | 1,064 | a year ago | ||||||||
A collection of awesome things regarding zeit's micro. | ||||||||||
Spock | 652 | 72 | 10 months ago | 62 | June 15, 2018 | 29 | Haskell | |||
Another Haskell web framework for rapid development | ||||||||||
Microwebsrv | 529 | 5 months ago | 8 | mit | Python | |||||
A micro HTTP Web server that supports WebSockets, html/python language templating and routing handlers, for MicroPython (used on Pycom modules & ESP32) |
Medeina is a Go routing tree based on HttpRouter and inspired by Ruby's Roda and Cuba. It allows to define the HTTP routes of your web application as a tree, operating on the current route at any point of the tree.
As stated in Roda's website, "this allows you to have much DRYer code". All the routes can have all the features of HttpRouter: named paramaters, catch-all parameters, etc.
Actually, Medeina inherits all the performance and flexibility you love in HttpRouter (great job, Julien!).
Medeina is fully functional and tested but it's still green and young. It may lack some useful functionality. If you use HttpRouter, give Medeina a try. All real world experience is welcome.
go get github.com/imdario/medeina
// use in your .go code
import (
"github.com/imdario/medeina"
)
Check the docs and these examples:
// From Roda's site
r := medeina.NewMedeina()
r.GET(func() {
r.Is("", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
http.Redirect(w, r, "/hello", http.StatusFound)
})
r.On("hello", func() {
r.Is("world", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprintf(w, "Hello world!")
})
r.Is("", func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
fmt.Fprintf(w, "Hello!")
})
})
})
log.Fatal(http.ListenAndServe(":8080", r))
And this for a quick and dirty "REST-like" API (ignore the fact that I'm using a single method to handle everything):
endpoints := []string {
"department", "employee", "project"
}
r := medeina.NewMedeina()
r.GET(func() {
r.Is("", Index)
})
for endpoint := range endpoints {
r.On(endpoint, func() {
r.GET(func() {
r.Is(":id", Model)
})
r.POST(func() {
r.Is("", Model)
})
r.PUT(func() {
r.Is("", Model)
})
r.DELETE(func() {
r.Is(":id", Model)
})
})
}
log.Fatal(http.ListenAndServe(":8080", r))
Or it's "shorter" (YMMV) form:
endpoints := []string {
"department", "employee", "project"
}
r := medeina.NewMedeina()
r.Is("", Index, medeina.GET)
for endpoint := range endpoints {
r.On(endpoint, func() {
r.Is("", Model, medeina.POST, medeina.PUT)
r.Is(":id", Model, medeina.GET, medeina.DELETE)
})
}
log.Fatal(http.ListenAndServe(":8080", r))
What does "" means? It matches the current path in your route. It's a way to easily match the scope itself as canonical URL.
Because it's the most fast and flexible Go HTTP router around the town and a good one to start. If you want Medeina to work with your preferred option, patches are welcome!
If you don't know HttpRouter, please check it out. You won't regret it.
From Wikipedia:
Medeina or Medeinė (derived from medis (tree) and medė (forest)), [...] is one of the main deities in the Lithuanian mythology, similar to Latvian Meža Māte. She is a ruler of forests, trees and animals. Her sacred animal is a hare.
Hey, we were talking about trees. It fits right! Also, this project can join my other ones, also called by names starting by 'm': Mergo, Minshu, mqqsig192, etc. Don't ask, it wasn't on purpose.
If I can help you, you have an idea or you are using Medeina in your projects, don't hesitate to drop me a line (or a pull request): @im_dario
Written by Dario Castañé.
MIT license.