Created
June 14, 2017 06:51
-
-
Save jonahgeorge/865d4678702cae9794da0b047d0e4bfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net/http" | |
"log" | |
"io/ioutil" | |
"github.com/russross/blackfriday" | |
) | |
const FILENAME = "../jonahgeorge.github.io/_posts/2017-06-13-getting-go-ing.md" | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
f, _ := ioutil.ReadFile(FILENAME) | |
unsafe := blackfriday.MarkdownCommon(f) | |
w.Header().Set("Content-Type", "text/html") | |
fmt.Fprintf(w, "%s", unsafe) | |
}) | |
log.Fatal(http.ListenAndServe(":8080", nil)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment