generated from VLADIMIR/template
update routes
This commit is contained in:
@@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
ClientPort = ":8100"
|
||||
GrpcGatewayPort = ":8090"
|
||||
UserClientPort = ":8100"
|
||||
AdminClientPort = ":8110"
|
||||
FilePort = ":8120"
|
||||
)
|
||||
@@ -20,7 +21,19 @@ func GetDBFilepath() string {
|
||||
return getFilepath("DB_FILENAME", "data/db/store.db")
|
||||
}
|
||||
|
||||
func GetAdminHost() string {
|
||||
func GetGrpcGatewayHost() string {
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
return host
|
||||
}
|
||||
ips, err := getLocalIPs()
|
||||
if err != nil || len(ips) == 0 {
|
||||
return "http://127.0.0.1" + GrpcGatewayPort
|
||||
}
|
||||
return "http://" + ips[0] + GrpcGatewayPort
|
||||
}
|
||||
|
||||
func GetAdminClientHost() string {
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
return host
|
||||
@@ -32,20 +45,20 @@ func GetAdminHost() string {
|
||||
return "http://" + ips[0] + AdminClientPort
|
||||
}
|
||||
|
||||
func GetHost() string {
|
||||
func GetUserClientHost() string {
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
return host
|
||||
}
|
||||
ips, err := getLocalIPs()
|
||||
if err != nil || len(ips) == 0 {
|
||||
return "http://127.0.0.1" + ClientPort
|
||||
return "http://127.0.0.1" + UserClientPort
|
||||
}
|
||||
return "http://" + ips[0] + ClientPort
|
||||
return "http://" + ips[0] + UserClientPort
|
||||
}
|
||||
|
||||
func GetFileHost() string {
|
||||
host := os.Getenv("FILE_HOST")
|
||||
host := os.Getenv("HOST")
|
||||
if host != "" {
|
||||
return host
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user