From b0e413319d9303b803138b576ec77dfd5857fa1c Mon Sep 17 00:00:00 2001 From: tatyam Date: Thu, 16 Jun 2022 23:02:01 +0900 Subject: [PATCH] =?UTF-8?q?/echo=20=E3=82=92=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/router.go | 5 +++++ showcase.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/router/router.go b/router/router.go index e1f4cc7..ba21af8 100644 --- a/router/router.go +++ b/router/router.go @@ -1,6 +1,7 @@ package router import ( + "fmt" "net/http" "os" @@ -12,6 +13,10 @@ func SetRouting() { e.GET("/ping", func(c echo.Context) error { return c.String(http.StatusOK, "pong") }) + e.GET("/echo", func(c echo.Context) error { + header := fmt.Sprintf("%#v", c.Request().Header) + return c.String(http.StatusOK, header) + }) port := os.Getenv("PORT") if port == "" { diff --git a/showcase.yaml b/showcase.yaml index 74c39ab..3b91099 100644 --- a/showcase.yaml +++ b/showcase.yaml @@ -8,7 +8,7 @@ entrypoint: ./main http_proxy: 3000 https: hard - +internal: soft # cname: # TODO