Files
2024-05-07 21:33:51 +08:00

29 lines
699 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package main
import (
"blog/api"
"blog/config"
"blog/models"
"blog/routes"
"fmt"
"net/http"
"strconv"
)
func init() {
models.CompiledContent() //克隆或者更新文章、递归生成文章、导航、短链 Map、加载模板
}
func main() {
routes.InitRoute()
api.InitApi()
fmt.Printf("Version:v%v \n", config.Cfg.Version)
fmt.Printf("ListenAndServe On Port %v \n", config.Cfg.Port)
fmt.Printf("Dashboard On Path %v \n", config.Cfg.Dashboard)
fmt.Printf("UpdateArticle's GitHookUrl: %v Secret: %v \n", config.Cfg.GitHookUrl, config.Cfg.WebHookSecret)
if err := http.ListenAndServe(":"+strconv.Itoa(config.Cfg.Port), nil); err != nil {
fmt.Println("ServeErr:", err)
}
}