service v.1

This commit is contained in:
andrusyakka
2024-07-04 17:35:04 +03:00
parent 28425f05a8
commit c9e3f13fe1
5 changed files with 96 additions and 0 deletions

25
main.go Normal file
View File

@@ -0,0 +1,25 @@
package main
import (
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"net/http"
)
func getRoot(c echo.Context) error {
return c.String(http.StatusOK, "Hello, World!")
}
func main() {
e := echo.New()
// Middleware
e.Use(middleware.Logger())
e.Use(middleware.Recover())
// Routes
e.GET("/", getRoot)
// Start server
e.Logger.Fatal(e.Start(":8080"))
}