Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
codegangsta committed Nov 9, 2013
1 parent fa6cfd9 commit 5080197
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,19 @@ m.Get("/", func() string {
})
~~~

Handlers are invoked via reflection, so Martini can inject services into Handler arguments:
Handlers are invoked via reflection, so Martini can inject services into Handler arguments. This makes Martini completely compatible with golang's `http.HandlerFunc` interface:
~~~ go
m.Get("/", func(res http.ResponseWriter, req *http.Request) {
res.WriteHead(200) // HTTP 200
})
~~~

The following services are included with a `martini.Classic()`:
* `*log.Logger` - Global logger for Martini
* [martini.Context](http://godoc.org/github.com/codegangsta/martini#Context) - http request context
* `http.ResponseWriter` - http Response writer interface
* `*http.Request` - http Request

### Routing
In Martini, a route is an HTTP method paired with a URL-matching pattern.
Each route can take one or more handler methods:
Expand Down

0 comments on commit 5080197

Please sign in to comment.