Init v3.2
This commit is contained in:
24
routes/main.go
Normal file
24
routes/main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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)
|
||||
|
||||
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"))))
|
||||
|
||||
}
|
Reference in New Issue
Block a user