diff --git a/cmd/dwelling-upload/main.go b/cmd/dwelling-upload/main.go index be4cd06..6b11a60 100644 --- a/cmd/dwelling-upload/main.go +++ b/cmd/dwelling-upload/main.go @@ -6,6 +6,7 @@ import ( "dwelling-upload/pkg/server" "flag" "log" + "net/http" "os" "os/signal" "syscall" @@ -25,11 +26,11 @@ func main() { srv := server.NewHttpServer() - srv.ServeStatic("/assets/*filepath", handlers.StaticAssets()) + srv.ServeStatic("/assets/*filepath", http.Dir(config.WebDir+"/assets")) srv.GET("/", hand.Index) srv.POST("/", hand.Upload) - srv.GET("/:hash/:name", hand.Upload) + srv.GET("/f/:hash/:name", hand.Download) if err := srv.Start(config.SplitNetworkAddress()); err != nil { log.Fatalln(err)