diff --git a/cmd/http/views/index.hbs b/cmd/http/views/index.hbs index 6e52088..e92bebf 100644 --- a/cmd/http/views/index.hbs +++ b/cmd/http/views/index.hbs @@ -121,7 +121,7 @@ } jsonValue, _ := json.Marshal(order) - _, err := http.Post("https://yourwebsite.com/order", "application/json", bytes.NewBuffer(jsonValue)) + _, err := http.Post("{{host}}/order", "application/json", bytes.NewBuffer(jsonValue)) if err != nil { // handle error } @@ -142,7 +142,7 @@ client_email: 'client@example.com' }; - axios.post('https://yourwebsite.com/order', order) + axios.post('{{host}}/order', order) .then(response => { console.log(response.data); }) @@ -155,7 +155,7 @@

CURL

             
-                curl -X POST https://yourwebsite.com/order \
+                curl -X POST {{host}}/order \
                 -H 'Content-Type: application/json' \
                 -d '{
                     "order_id": "123",
diff --git a/internal/api/server.go b/internal/api/server.go
index 17664ce..5893d66 100644
--- a/internal/api/server.go
+++ b/internal/api/server.go
@@ -138,7 +138,9 @@ func (s *RestServer) loadViews(imagesDir string) {
 	s.app.Static("/images", imagesDir)
 
 	s.app.Get("/", func(c *fiber.Ctx) error {
-		return c.Render("index", fiber.Map{})
+		return c.Render("index", fiber.Map{
+			"host": s.config.Host,
+		})
 	})
 
 	s.app.Get("/error", func(c *fiber.Ctx) error {