generated from VLADIMIR/template
up
This commit is contained in:
@@ -7,8 +7,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ClientPort = ":8100"
|
||||
FilePort = ":8120"
|
||||
ClientPort = ":8100"
|
||||
AdminClientPort = ":8110"
|
||||
FilePort = ":8120"
|
||||
)
|
||||
|
||||
func GetStoryFilepath() string {
|
||||
@@ -19,6 +20,18 @@ func GetDBFilepath() string {
|
||||
return getFilepath("DB_FILENAME", "data/db/store.db")
|
||||
}
|
||||
|
||||
func GetAdminHost() string {
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
return host
|
||||
}
|
||||
ips, err := getLocalIPs()
|
||||
if err != nil || len(ips) == 0 {
|
||||
return "http://127.0.0.1" + AdminClientPort
|
||||
}
|
||||
return "http://" + ips[0] + AdminClientPort
|
||||
}
|
||||
|
||||
func GetHost() string {
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
|
||||
Reference in New Issue
Block a user