1 Star 4 Fork 1

xmdhs/genshin-card

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
main.go 623 Bytes
Copy Edit Raw Blame History
xmdhs authored 2022-12-13 16:57 . 更改默认端口
package main
import (
"encoding/json"
"flag"
"log"
"os"
"github.com/xmdhs/genshin-card/server"
)
func main() {
cookie := os.Getenv("COOKIE")
if cookie == "" {
b, err := os.ReadFile("cookie.txt")
if err != nil {
panic(err)
}
cookie = string(b)
}
cookies := map[string][]string{}
err := json.Unmarshal([]byte(cookie), &cookies)
if err != nil {
panic(err)
}
log.Println(server.Server(addr, cookies))
}
var (
addr string
)
func init() {
flag.StringVar(&addr, "addr", ":0", "http server address")
flag.Parse()
if addr == ":0" && os.Getenv("PORT") != "" {
addr = ":" + os.Getenv("PORT")
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xmdhs/genshin-card.git
git@gitee.com:xmdhs/genshin-card.git
xmdhs
genshin-card
genshin-card
master

Search