update cart deployment
Some checks failed
Build and Publish / BuildAndDeploy (push) Successful in 4m34s
Build and Publish / BuildAndDeployAmd64 (push) Has been cancelled

This commit is contained in:
2025-09-26 23:06:27 +02:00
parent 9e4d5df733
commit 25cf3f8005
2 changed files with 32 additions and 12 deletions

View File

@@ -2,15 +2,26 @@ package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"github.com/matst80/slask-finder/pkg/index"
)
/** end */
var baseUrl string
func init() {
baseUrl = "https://slask-finder.tornberg.me"
envUrl := os.Getenv("BASE_URL")
if envUrl != "" {
baseUrl = envUrl
}
}
func FetchItem(sku string) (*index.DataItem, error) {
res, err := http.Get("https://slask-finder.tornberg.me/api/by-sku/" + sku)
res, err := http.Get(fmt.Sprintf("%s/api/by-sku/%s", baseUrl, sku))
if err != nil {
return nil, err
}