generated from VLADIMIR/template
add images
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user