Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Dri0m authored Sep 10, 2023
1 parent 69feda0 commit 06022f4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion backend/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ func main() {

// static fileserver
http.HandleFunc("/", rootHandler)
http.HandleFunc("/faq", faqHandler)
fs := http.FileServer(http.Dir("../static"))
http.Handle("/static/", http.StripPrefix("/static", fs))

Expand All @@ -133,7 +134,12 @@ func main() {

func rootHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "../static/index.html")
log.Debug().Msg("served root")
log.Debug().Msg("served /")
}

func faqHandler(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "../static/faq/index.html")
log.Debug().Msg("served /faq")
}

// Return JSON-formatted info about a specific or random entry
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<div class="footer">
<div class="navigation">
<div class="general">
<a href="faq" target="_blank">[FAQ]</a>
<a href="browse">[Browse]</a>
<a href="/faq" target="_blank">[FAQ]</a>
<a href="/browse">[Browse]</a>
<a href=".">[Random]</a>
<div class="toggle">
<input type="checkbox" id="extreme" checked><label for="extreme">Filter NSFW</label>
Expand Down

0 comments on commit 06022f4

Please sign in to comment.