Skip to content
This repository was archived by the owner on Aug 24, 2022. It is now read-only.

Commit f81a675

Browse files
author
Peter Renström
committed
Improve handler for landing page.
1 parent df9aef2 commit f81a675

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

handlers.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,15 @@ import (
1414
const imageTypes = ".jpg .jpeg .png .gif"
1515

1616
func HomeHandler(w http.ResponseWriter, r *http.Request) {
17-
fmt.Fprintln(w, "Hello world!")
17+
md, err := ioutil.ReadFile(options.Dir + "/home.md")
18+
if err != nil {
19+
log.Fatalln(err)
20+
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
21+
return
22+
}
23+
24+
wiki := Wiki{Markdown: md, template: options.template}
25+
wiki.Write(w)
1826
}
1927

2028
func WikiHandler(w http.ResponseWriter, r *http.Request) {

0 commit comments

Comments
 (0)