32 lines
568 B
Go
32 lines
568 B
Go
package main
|
|
|
|
import (
|
|
"elepower/api"
|
|
"elepower/core"
|
|
"os"
|
|
)
|
|
|
|
// +windows go run . -rod=show,devtools
|
|
// +linux go run . -rod=show,devtools
|
|
func main() {
|
|
// 创建一个新的Gin服务器
|
|
server := api.NewGinServer()
|
|
|
|
// 直接登录
|
|
if api.Spider.LoginPage() {
|
|
core.Log.Infof(
|
|
"%s 服务器启动成功:> http://localhost:%s ",
|
|
core.Titile, core.Config.RunPort,
|
|
)
|
|
}
|
|
|
|
// 启动服务器
|
|
if err := server.Run(":" + core.Config.RunPort); err != nil {
|
|
core.Log.Debugf(
|
|
"%s 服务器启动失败: %v\n",
|
|
core.Titile, err,
|
|
)
|
|
os.Exit(1)
|
|
}
|
|
}
|