1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00

Adds example to readme (#1044)

This commit is contained in:
Brian Danowski 2018-01-29 23:00:48 -05:00 committed by Vishal Rana
parent 2769113edf
commit 65f3fcbfe2

View File

@ -30,6 +30,37 @@
## [Get Started](https://echo.labstack.com/guide)
### Example:
```
package main
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func main() {
// Echo instance
e := echo.New()
// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())
// Routes
e.GET("/", hello)
// Start server
e.Logger.Fatal(e.Start(":1323"))
}
// Handler
func hello(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
}
```
## Support Us
- :star: the project