This commit is contained in:
2vb 2024-05-29 00:30:33 -07:00
parent f301bfd90e
commit e5e3c59521

View File

@ -3,11 +3,8 @@ package storage
import (
"embed"
"encoding/json"
"io"
"net/http"
"os"
"strings"
"github.com/ectrc/snow/aid"
)
var (
@ -29,15 +26,15 @@ func Asset(file string) (*[]byte) {
}
func HttpAsset[T interface{}](file string) (*T) {
client := http.Client{}
// client := http.Client{}
resp, err := client.Get(aid.Config.API.Host + "/snow/httpassets/" + file)
// resp, err := client.Get("https://raw.githubusercontent.com/ectrc/ectrc/main/" + file)
if err != nil {
return nil
}
// if err != nil {
// return nil
// }
data, err := io.ReadAll(resp.Body)
data, err := os.ReadFile("./data/" + file)
// data, err := io.ReadAll(resp.Body)
if err != nil {
return nil
}