add images

This commit is contained in:
2026-03-14 17:01:11 +07:00
parent ae82f8e0d9
commit 3a30123096
10 changed files with 65 additions and 32 deletions
+13
View File
@@ -8,6 +8,7 @@ import (
const (
ClientPort = ":8100"
FilePort = ":8120"
)
func GetStoryFilepath() string {
@@ -30,6 +31,18 @@ func GetHost() string {
return "http://" + ips[0] + ClientPort
}
func GetFileHost() string {
host := os.Getenv("FILE_HOST")
if host != "" {
return host
}
ips, err := getLocalIPs()
if err != nil || len(ips) == 0 {
return "http://127.0.0.1" + FilePort
}
return "http://" + ips[0] + FilePort
}
func getFilepath(env string, defaultFilepath string) string {
filepath := selectFilepath(env, defaultFilepath)
ensureDirExists(filepath)