Created
August 8, 2021 15:51
-
-
Save gertjana/621274a4cd292d8e9b0f4c707aef0aed to your computer and use it in GitHub Desktop.
small go webservice
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
"github.com/labstack/echo/v4" | |
"github.com/labstack/echo/v4/middleware" | |
) | |
func main() { | |
e := echo.New() | |
e.Use(middleware.Logger()) | |
e.Use(middleware.Recover()) | |
e.GET("/", hello) | |
e.Logger.Fatal(e.Start(":8000")) | |
} | |
func hello(c echo.Context) error { | |
return c.String(http.StatusOK, "Hello, World!") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment