27 lines
672 B
Go
27 lines
672 B
Go
package main
|
||
|
||
import (
|
||
"blog/config"
|
||
"blog/models"
|
||
"blog/routes"
|
||
"fmt"
|
||
"net/http"
|
||
"strconv"
|
||
)
|
||
|
||
func init() {
|
||
models.CompiledContent() //克隆或者更新文章、递归生成文章、导航、短链 Map、加载模板
|
||
}
|
||
|
||
func main() {
|
||
|
||
routes.InitRoute()
|
||
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)
|
||
}
|
||
}
|