Merge pull request #48 from phoon/main

自定义监听地址配置
This commit is contained in:
微凉
2021-03-19 18:45:53 +08:00
committed by GitHub
3 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@ package bootstrap
import (
"flag"
"fmt"
"github.com/Xhofe/alist/conf"
serv "github.com/Xhofe/alist/server"
"github.com/gin-gonic/gin"
@ -71,7 +72,7 @@ func start() {
// start http server
func server() {
baseServer := "0.0.0.0:" + conf.Conf.Server.Port
baseServer := conf.Conf.Server.Address + ":" + conf.Conf.Server.Port
r := gin.Default()
serv.InitRouter(r)
log.Infof("Starting server @ %s", baseServer)

View File

@ -10,6 +10,7 @@ info:
preview:
text: [txt,htm,html,xml,java,properties,sql,js,md,json,conf,ini,vue,php,py,bat,gitignore,yml,go,sh,c,cpp,h,hpp] #要预览的文本文件的后缀,可以自行添加
server:
address: "0.0.0.0"
port: "5244"
search: true
static: dist

View File

@ -31,6 +31,7 @@ type Config struct {
} `yaml:"preview" json:"preview"`
} `yaml:"info"`
Server struct {
Address string `yaml:"address"`
Port string `yaml:"port"` //端口
Search bool `yaml:"search"` //允许搜索
Static string `yaml:"static"`