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("/album", controller.Album)
	http.HandleFunc("/talk", controller.Talk)

	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"))))

}