Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 355 Bytes

Step02.md

File metadata and controls

29 lines (21 loc) · 355 Bytes

Step 2. Add the server code

Create the main.go

cmd/main.go

package main

import (
	"net/http"
	
	"github.com/labstack/echo"
)

func main() {
	e := echo.New()
	e.GET("/", func(c echo.Context) error {
		return c.String(http.StatusOK, "RealWorld!")
	})
	e.Logger.Fatal(e.Start(":3333"))
}

Run

go run cmd/main.go