generated from VLADIMIR/template
up
This commit is contained in:
parent
1a51f10c54
commit
40c36bb784
@ -51,6 +51,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clientHost := config.GetHost()
|
clientHost := config.GetHost()
|
||||||
|
adminClientHost := config.GetAdminHost()
|
||||||
fileHost := config.GetFileHost()
|
fileHost := config.GetFileHost()
|
||||||
|
|
||||||
cleaner := cleaner.NewCleaner()
|
cleaner := cleaner.NewCleaner()
|
||||||
@ -168,7 +169,7 @@ func main() {
|
|||||||
muxAdmin.Handle("/", fileServerAdmin)
|
muxAdmin.Handle("/", fileServerAdmin)
|
||||||
|
|
||||||
// Serve admin web server
|
// Serve admin web server
|
||||||
log.Println("Serving admin web on http://0.0.0.0:8110")
|
log.Printf("Serving admin web on %s\n", adminClientHost)
|
||||||
log.Fatalln(http.ListenAndServe(":8110", muxAdmin))
|
log.Fatalln(http.ListenAndServe(":8110", muxAdmin))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
115
cmd/evening_detective/static/admin/assets/index-CH9kKe_e.js
Normal file
115
cmd/evening_detective/static/admin/assets/index-CH9kKe_e.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -5,8 +5,8 @@
|
|||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>ВД Админка</title>
|
<title>ВД Админка</title>
|
||||||
<script type="module" crossorigin src="/assets/index-Bsz6dkXJ.js"></script>
|
<script type="module" crossorigin src="/assets/index-CH9kKe_e.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-CPNDoyHf.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-C16dKKOO.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
ClientPort = ":8100"
|
ClientPort = ":8100"
|
||||||
|
AdminClientPort = ":8110"
|
||||||
FilePort = ":8120"
|
FilePort = ":8120"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,6 +20,18 @@ func GetDBFilepath() string {
|
|||||||
return getFilepath("DB_FILENAME", "data/db/store.db")
|
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 {
|
func GetHost() string {
|
||||||
host := os.Getenv("HOST")
|
host := os.Getenv("HOST")
|
||||||
if host != "" {
|
if host != "" {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user