I really like the look of this. There's some very clever API design going on here, and it's clearly taking advantage of Go's language features rather than just trying to be a clone of a framework from another language.<p>I particularly like the service injection concept. Django forces every view function to take a request object and return a response object. Flask makes these optional, but then requires you to use global variables to access more information from the request. Martini attempts to resolve any arguments it sees by looking up their static type against a service directory. I think that's really clever.<p>The way it allows you to stack up Handlers is neat too. Django does this with either globally applied middleware or per-view-function decorators, but there's something really neat about just taking a list of functions for things like authentication and "stacking" them on top of each other - or having that same function applied as middleware to every request using m.Use(func...). Using Context.Next() to allow that middleware to "wrap" a request (the equivalent of Django's process_request and process_response pair) is clever as well.<p>Colour me impressed!
A list of Go webframeworks. Sorted by activity. Last commit as of 14. Nov 2013<p><a href="https://github.com/codegangsta/martini" rel="nofollow">https://github.com/codegangsta/martini</a>
Last commit: 2 hours
HN discussion: <a href="https://news.ycombinator.com/item?id=6731022" rel="nofollow">https://news.ycombinator.com/item?id=6731022</a><p><a href="https://github.com/astaxie/beego" rel="nofollow">https://github.com/astaxie/beego</a>
Last commit: 1 day ago<p><a href="https://github.com/robfig/revel" rel="nofollow">https://github.com/robfig/revel</a>
Last commit: 4 days ago
<a href="https://news.ycombinator.com/item?id=5996712" rel="nofollow">https://news.ycombinator.com/item?id=5996712</a><p><a href="https://github.com/aaronlifton/Gooo" rel="nofollow">https://github.com/aaronlifton/Gooo</a>
Last commit: 1 month ago
<a href="https://news.ycombinator.com/item?id=5057108" rel="nofollow">https://news.ycombinator.com/item?id=5057108</a><p><a href="https://github.com/hoisie/web" rel="nofollow">https://github.com/hoisie/web</a>
Last commit: 5 months ago
<a href="https://news.ycombinator.com/item?id=6715547" rel="nofollow">https://news.ycombinator.com/item?id=6715547</a><p><a href="https://github.com/paulbellamy/mango" rel="nofollow">https://github.com/paulbellamy/mango</a>
Last commit: 9 months ago
Author here. Super flattered to see all the feedback coming in. I built this package to suit my own picky needs.<p>Martini is meant to be non-intrusive and braindead simple to use. Hope you guys like it!
I usually don't like video walk-throughs, but this one was very snappy and a pleasure to watch.<p>By a happy coincidence, I was just going to start building an API backend in Go today or tomorrow for a side project, and was thinking about doing it with vanilla Go but now I'll probably give Martini a shot (!).
Would be really nice if the demo was in a normal web page instead of a video. (Also, I'd love to know what vim(?) extension provides the interactive completion with the function signatures! That looks really cool.)
This appeared in reddit[1] before Hacker News and he has already been asked[2] how does this compare to revel and beego.<p>[1] <a href="http://www.reddit.com/r/golang/comments/1qlfvp/martini_classy_web_development_in_go/" rel="nofollow">http://www.reddit.com/r/golang/comments/1qlfvp/martini_class...</a><p>[2] <a href="http://www.reddit.com/r/golang/comments/1qlfvp/martini_classy_web_development_in_go/cde0yez" rel="nofollow">http://www.reddit.com/r/golang/comments/1qlfvp/martini_class...</a>
Great work Jeremy. Although there are a number of web frameworks similar to Sinatra on go, this feels to me to be the most natural. The care taken to present this well shows this project has promise.<p>Are you looking to make this more full featured with an ORM/persistence layer (i.e Rails) or keep it small and similar to Sinatra?
Newbie question here, I've looked into gorilla/mux before, how does Martini compare to it? Do they serve the same purpose? Does it offer more features? Is it easier to use?<p>Great-looking website by the way. The first impression is a good impression, it's very polished.
Very nice. It can be easily used to serve subtrees of another go web framework that accepts http.Handler (e.g. appengine):<p><pre><code> m := martini.Classic()
// ...
http.Handle("/", m)</code></pre>
This is amazing, I love the DI with services! I always preferred Gorilla to things like Revel because it wasn't so opinionated, and this seems closer to Gorilla but with this clever idea of services.<p>I threw together an example app with templating and database access as services, I'm impressed by how concise it is.<p><a href="https://gist.github.com/mickhrmweb/7479583" rel="nofollow">https://gist.github.com/mickhrmweb/7479583</a>