Blog/routes/main.go

26 lines
847 B
Go
Raw Normal View History

2024-03-21 07:25:12 +00:00
package routes
import (
"blog/config"
"blog/controller"
"net/http"
)
func InitRoute() {
http.HandleFunc("/", controller.Index)
http.HandleFunc("/blog", controller.Index)
http.HandleFunc("/categories", controller.Category)
http.HandleFunc("/article", controller.Article)
http.HandleFunc("/extra-nav", controller.ExtraNav)
2024-05-07 13:33:51 +00:00
http.HandleFunc("/memos", controller.Memos)
2024-03-21 07:25:12 +00:00
http.HandleFunc(config.Cfg.GitHookUrl, controller.GithubHook)
http.HandleFunc(config.Cfg.Dashboard, controller.Dashboard)
http.Handle("/public/", http.StripPrefix("/public/", http.FileServer(http.Dir(config.Cfg.ThemesDir+"/public"))))
http.Handle("/assets/", http.StripPrefix("/assets/", http.FileServer(http.Dir(config.Cfg.DocumentAssetsDir))))
http.Handle("/images/", http.StripPrefix("/images/", http.FileServer(http.Dir(config.Cfg.CurrentDir+"/images"))))
}