Updated ServeStatic and GET file request handler and path.
This commit is contained in:
parent
d4e7a7fa25
commit
65ed3ec924
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user