allow to set address in configuration file
This commit is contained in:
@@ -3,6 +3,7 @@ package bootstrap
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/Xhofe/alist/conf"
|
"github.com/Xhofe/alist/conf"
|
||||||
serv "github.com/Xhofe/alist/server"
|
serv "github.com/Xhofe/alist/server"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
@@ -71,7 +72,7 @@ func start() {
|
|||||||
|
|
||||||
// start http server
|
// start http server
|
||||||
func server() {
|
func server() {
|
||||||
baseServer := "0.0.0.0:" + conf.Conf.Server.Port
|
baseServer := conf.Conf.Server.Address + ":" + conf.Conf.Server.Port
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
serv.InitRouter(r)
|
serv.InitRouter(r)
|
||||||
log.Infof("Starting server @ %s", baseServer)
|
log.Infof("Starting server @ %s", baseServer)
|
||||||
|
@@ -31,6 +31,7 @@ type Config struct {
|
|||||||
} `yaml:"preview" json:"preview"`
|
} `yaml:"preview" json:"preview"`
|
||||||
} `yaml:"info"`
|
} `yaml:"info"`
|
||||||
Server struct {
|
Server struct {
|
||||||
|
Address string `yaml:"address"`
|
||||||
Port string `yaml:"port"` //端口
|
Port string `yaml:"port"` //端口
|
||||||
Search bool `yaml:"search"` //允许搜索
|
Search bool `yaml:"search"` //允许搜索
|
||||||
Static string `yaml:"static"`
|
Static string `yaml:"static"`
|
||||||
|
Reference in New Issue
Block a user