Serve embed assets fs instead.
This commit is contained in:
parent
967e8e6878
commit
94437e3bab
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user