mirror of
https://github.com/labstack/echo.git
synced 2025-07-15 01:34:53 +02:00
Fixed indentation in code example. (#1338)
This commit is contained in:
committed by
Vishal Rana
parent
5d2c33ad5d
commit
b1bc80528b
27
README.md
27
README.md
@ -56,30 +56,29 @@ Lower is better!
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"github.com/labstack/echo/v4"
|
||||||
"github.com/labstack/echo/v4"
|
"github.com/labstack/echo/v4/middleware"
|
||||||
"github.com/labstack/echo/v4/middleware"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
// Echo instance
|
// Echo instance
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
|
|
||||||
// Middleware
|
// Middleware
|
||||||
e.Use(middleware.Logger())
|
e.Use(middleware.Logger())
|
||||||
e.Use(middleware.Recover())
|
e.Use(middleware.Recover())
|
||||||
|
|
||||||
// Routes
|
// Routes
|
||||||
e.GET("/", hello)
|
e.GET("/", hello)
|
||||||
|
|
||||||
// Start server
|
// Start server
|
||||||
e.Logger.Fatal(e.Start(":1323"))
|
e.Logger.Fatal(e.Start(":1323"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handler
|
// Handler
|
||||||
func hello(c echo.Context) error {
|
func hello(c echo.Context) error {
|
||||||
return c.String(http.StatusOK, "Hello, World!")
|
return c.String(http.StatusOK, "Hello, World!")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user