🎉
This commit is contained in:
29
main.go
Normal file
29
main.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"wireguard-dashboard/config"
|
||||
"wireguard-dashboard/initialize"
|
||||
"wireguard-dashboard/route"
|
||||
)
|
||||
|
||||
func init() {
|
||||
initialize.Init() // 初始化
|
||||
}
|
||||
|
||||
func main() {
|
||||
route.IncludeRouters()
|
||||
handler := route.InitRouter()
|
||||
|
||||
httpServe := http.Server{
|
||||
Addr: fmt.Sprintf(":%d", config.Config.Http.Port),
|
||||
Handler: handler,
|
||||
}
|
||||
|
||||
if err := httpServe.ListenAndServe(); err != nil {
|
||||
log.Panicf("启动http服务端失败: %v", err.Error())
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user