1 Star 0 Fork 7

欧阳炜标/ddns-go

forked from gavin56/ddns-go 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 794 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"ddns-go/dns"
"ddns-go/static"
"ddns-go/util"
"ddns-go/web"
"log"
"net/http"
"time"
)
const port = "9876"
func main() {
// 启动静态文件服务
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(static.AssetFile())))
http.Handle("/favicon.ico", http.StripPrefix("/", http.FileServer(static.AssetFile())))
http.HandleFunc("/", web.Writing)
http.HandleFunc("/save", web.Save)
http.HandleFunc("/logs", web.Logs)
// 打开浏览器
go util.OpenExplorer("http://127.0.0.1:" + port)
log.Println("启动端口", port, "...")
// 定时运行
go dns.RunTimer()
err := http.ListenAndServe(":"+port, nil)
if err != nil {
log.Println("启动端口发生异常, 1分钟后自动关闭此窗口", err)
time.Sleep(time.Minute)
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/oywb33/ddns-go.git
[email protected]:oywb33/ddns-go.git
oywb33
ddns-go
ddns-go
master

搜索帮助