mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: cross compile script
This commit is contained in:
15
main.go
15
main.go
@@ -1,18 +1,25 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"github.com/HFO4/cloudreve/bootstrap"
|
||||
"github.com/HFO4/cloudreve/pkg/conf"
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/HFO4/cloudreve/routers"
|
||||
)
|
||||
|
||||
var confPath string
|
||||
|
||||
func init() {
|
||||
bootstrap.Init("conf/conf.ini")
|
||||
flag.StringVar(&confPath, "c", "conf.ini", "配置文件路径")
|
||||
flag.Parse()
|
||||
bootstrap.Init(confPath)
|
||||
}
|
||||
|
||||
func main() {
|
||||
api := routers.InitRouter()
|
||||
|
||||
api.Run(conf.SystemConfig.Listen)
|
||||
|
||||
util.Log().Info("开始监听 %s", conf.SystemConfig.Listen)
|
||||
if err := api.Run(conf.SystemConfig.Listen); err != nil {
|
||||
util.Log().Error("无法监听[%s],%s", conf.SystemConfig.Listen, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user