Added Index, Stuff, Mindflow, About, Article, and RSS handlers.
This commit is contained in:
parent
70c04da954
commit
77a35e8f4b
@ -53,7 +53,12 @@ func main() {
|
||||
|
||||
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
|
||||
srv.GET("/", hand.Index)
|
||||
srv.GET("/stuff", hand.Stuff)
|
||||
srv.GET("/stuff/article/*filepath", hand.Article)
|
||||
srv.GET("/mindflow", hand.Mindflow)
|
||||
srv.GET("/about", hand.About)
|
||||
srv.GET("/robots.txt", hand.Robots)
|
||||
srv.GET("/rss.xml", hand.RSS)
|
||||
|
||||
if err := srv.Start(network, *listenAddress); err != nil {
|
||||
log.Fatalln(err)
|
||||
|
@ -2,6 +2,7 @@ package http
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"git.arav.top/Arav/dwelling-home/web"
|
||||
@ -27,6 +28,39 @@ func (h *Handlers) AssetsFS() http.FileSystem {
|
||||
}
|
||||
|
||||
func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) {
|
||||
web.Index("", w)
|
||||
}
|
||||
|
||||
func (h *Handlers) Stuff(w http.ResponseWriter, r *http.Request) {
|
||||
web.Stuff("/ Stuff", "", "", w)
|
||||
}
|
||||
|
||||
func (h *Handlers) Mindflow(w http.ResponseWriter, r *http.Request) {
|
||||
web.Mindflow("/ Mindflow", nil, r, w)
|
||||
}
|
||||
|
||||
func (h *Handlers) About(w http.ResponseWriter, r *http.Request) {
|
||||
web.About("/ About", "", nil, w)
|
||||
}
|
||||
|
||||
func (h *Handlers) Article(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "hardening_mikrotik") {
|
||||
web.ArticleHardeningMikrotik("/ Article / Hardening Mikrotik", w)
|
||||
} else if strings.HasSuffix(r.URL.Path, "nginx_recipes_and_tips") {
|
||||
web.ArticleNginxRecipesAndTips("/ Article / NGiNX's recipes & tips", w)
|
||||
} else if strings.HasSuffix(r.URL.Path, "setting_up_a_mail_server") {
|
||||
web.ArticleSettingUpAMailServer("/ Article / Setting up a mail server", w)
|
||||
} else if strings.HasSuffix(r.URL.Path, "setting_up_a_tor_proxy_relay_hiddenserv") {
|
||||
web.ArticleSettingUpATorProxyRelayHiddenserv("/ Article / Setting up a Tor proxy, relay and hidden service", w)
|
||||
} else if strings.HasSuffix(r.URL.Path, "rpi_root_on_external_drive") {
|
||||
web.ArticleSettingUpATorProxyRelayHiddenserv("/ Article / How to move a root partition from SD card off to external drive on Raspberry Pi", w)
|
||||
} else {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handlers) RSS(w http.ResponseWriter, r *http.Request) {
|
||||
web.RSS(r.Host, "Arav", nil, r, w)
|
||||
}
|
||||
|
||||
func (h *Handlers) Robots(w http.ResponseWriter, r *http.Request) {
|
||||
|
Loading…
Reference in New Issue
Block a user