1
0
mirror of https://github.com/labstack/echo.git synced 2025-07-17 01:43:02 +02:00

fixed docs

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2016-11-14 23:54:21 -08:00
parent c5a3575d4c
commit 43e95a6924
6 changed files with 26 additions and 70 deletions

49
echo.go
View File

@ -3,39 +3,36 @@ Package echo implements a fast and unfancy HTTP server framework for Go (Golang)
Example:
package main
package main
import (
"net/http"
import (
"net/http"
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
"github.com/labstack/echo/middleware"
"net"
"net"
)
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
// Handler
func hello(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
}
// Handler
func hello(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
}
func main() {
// Echo instance
e := echo.New()
func main() {
// Echo instance
e := echo.New()
// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())
// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())
// Routes
e.GET("/", hello)
// Routes
e.GET("/", hello)
// Start server
if err := e.Start(":1323"); err != nil {
e.Logger.Fatal(err)
}
}
// Start server
if err := e.Start(":1323"); err != nil {
e.Logger.Fatal(err)
}
}
Learn more at https://echo.labstack.com
*/