mirror of
https://github.com/labstack/echo.git
synced 2025-04-02 22:05:34 +02:00
27 lines
329 B
Go
27 lines
329 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"github.com/labstack/echo"
|
||
|
mw "github.com/labstack/echo/middleware"
|
||
|
)
|
||
|
|
||
|
// Handler
|
||
|
func hello(c *echo.Context) {
|
||
|
c.String(http.StatusOK, "Hello, World!\n")
|
||
|
}
|
||
|
|
||
|
func main() {
|
||
|
e := echo.New()
|
||
|
|
||
|
// Middleware
|
||
|
e.Use(mw.Logger)
|
||
|
|
||
|
// Routes
|
||
|
e.Get("/", hello)
|
||
|
|
||
|
// Start server
|
||
|
e.Run(":8080")
|
||
|
}
|