Add asset handling

This commit is contained in:
Eliot Whalan 2016-06-23 11:37:58 +10:00
parent 7cc828b7dd
commit 492aadd585
No known key found for this signature in database
GPG Key ID: C0A42175139840D6
1 changed files with 3 additions and 0 deletions

View File

@ -220,6 +220,9 @@ func main() {
router.HandleFunc("/save/{output}", saveHandler)
router.HandleFunc("/del/{pasteId}/{delKey}", delHandler)
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)
if err != nil {
log.Fatal(err)