Add asset handling
This commit is contained in:
parent
eb92988565
commit
90f50948b8
3
main.go
3
main.go
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue