Skip to content

Commit

Permalink
add some logging print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
vimeh committed Sep 11, 2023
1 parent 3510b4d commit f9369eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main.go
Expand Up @@ -54,6 +54,7 @@ func uploadHandler(w http.ResponseWriter, r *http.Request) {
}
defer htmlFile.Close()

fmt.Println("Writing markdown to HTML file")
io.WriteString(htmlFile, string(htmlContent))

http.Redirect(w, r, "/", http.StatusSeeOther)
Expand Down Expand Up @@ -87,6 +88,7 @@ func renderHandler(w http.ResponseWriter, r *http.Request) {
}

func downloadHandler(w http.ResponseWriter, r *http.Request) {
fmt.Println("Downloading markdown file")
mdContent, err := os.ReadFile(markdownFilePath)
if err != nil {
http.Error(w, "File not found", http.StatusNotFound)
Expand All @@ -106,4 +108,3 @@ func main() {
fmt.Println("Server started at :8080")
http.ListenAndServe(":8080", nil)
}

0 comments on commit f9369eb

Please sign in to comment.