Add asset handling

This commit is contained in:
Eliot Whalan 2016-06-23 11:37:58 +10:00
parent eb92988565
commit 90f50948b8
1 changed files with 3 additions and 0 deletions

View File

@ -220,6 +220,9 @@ func main() {
router.HandleFunc("/save/{output}", saveHandler) router.HandleFunc("/save/{output}", saveHandler)
router.HandleFunc("/del/{pasteId}/{delKey}", delHandler) router.HandleFunc("/del/{pasteId}/{delKey}", delHandler)
router.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/")))) router.PathPrefix("/").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/"))))
router.PathPrefix("/css").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/css/"))))
router.PathPrefix("/js").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/js/"))))
router.PathPrefix("/fonts").Handler(http.StripPrefix("/", http.FileServer(http.Dir("static/fonts/"))))
err := http.ListenAndServe(PORT, router) err := http.ListenAndServe(PORT, router)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)