From 8bdbf0ae0fe4e184866a96db47eae58781e9a9a3 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Sun, 10 May 2015 19:24:35 -0700 Subject: [PATCH] Updated docs Signed-off-by: Vishal Rana --- website/docs/guide.md | 10 +++++----- website/docs/index.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/guide.md b/website/docs/guide.md index 37b3e888..930c2dfa 100644 --- a/website/docs/guide.md +++ b/website/docs/guide.md @@ -65,8 +65,8 @@ data structure which makes routing lookup really fast. It leverages [sync pool](https://golang.org/pkg/sync/#Pool) to reuse memory and achieve zero dynamic memory allocation with no GC overhead. -Routes can be registered for any HTTP method, path and handler. For example, code -below registers a route for method `GET`, path `/hello` and a handler which sends +Routes can be registered by specifying HTTP method, path and a handler. For example, +code below registers a route for method `GET`, path `/hello` and a handler which sends `Hello!` HTTP response. ```go @@ -87,9 +87,9 @@ types of handlers. ### Path parameter -URL path parameters can be extracted either by name `echo.Context.Param(name string) string` or by -index `echo.Context.P(i uint8) string`. Getting parameter by index gives a slightly -better performance. +URL path parameters can be extracted either by name `echo.Context.Param(name string) string` +or by index `echo.Context.P(i uint8) string`. Getting parameter by index gives a +slightly better performance. ```go echo.Get("/users/:id", func(c *echo.Context) *HTTPError { diff --git a/website/docs/index.md b/website/docs/index.md index c1567b20..894319de 100644 --- a/website/docs/index.md +++ b/website/docs/index.md @@ -89,8 +89,8 @@ made to the server, producing output 2015/04/25 12:15:29 GET / 200 5.434µs ``` -`e.Get("/", hello)` Registers a GET route for path `/` with hello handler, so -whenever server receives an HTTP request at `/`, hello handler is called. +`e.Get("/", hello)` Registers hello handler for HTTP method `GET` and path `/`, so +whenever server receives an HTTP request at `/`, hello function is called. In hello handler `c.String(http.StatusOK, "Hello, World!\n")` sends a text/plain HTTP response to the client with 200 status code.