1
0

Serve embed assets fs instead.

This commit is contained in:
Alexander Andreev 2022-02-08 17:46:16 +04:00
parent 967e8e6878
commit 94437e3bab
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -9,7 +9,6 @@ import (
"dwelling-upload/pkg/watcher" "dwelling-upload/pkg/watcher"
"flag" "flag"
"log" "log"
"net/http"
"os" "os"
"os/signal" "os/signal"
"os/user" "os/user"
@ -96,7 +95,8 @@ func main() {
srv := server.NewHttpServer() srv := server.NewHttpServer()
srv.SetNotFoundHandler(hand.NotFound) srv.SetNotFoundHandler(hand.NotFound)
srv.ServeStatic("/assets/*filepath", http.Dir(config.WebDir+"/assets")) // srv.ServeStatic("/assets/*filepath", http.Dir(config.WebDir+"/assets"))
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
srv.GET("/", hand.Index) srv.GET("/", hand.Index)
srv.POST("/", hand.Upload) srv.POST("/", hand.Upload)
srv.GET("/f/:hash/:name", hand.Download) srv.GET("/f/:hash/:name", hand.Download)