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"
|
"dwelling-upload/pkg/server"
|
||||||
"flag"
|
"flag"
|
||||||
"log"
|
"log"
|
||||||
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"syscall"
|
"syscall"
|
||||||
@ -25,11 +26,11 @@ func main() {
|
|||||||
|
|
||||||
srv := server.NewHttpServer()
|
srv := server.NewHttpServer()
|
||||||
|
|
||||||
srv.ServeStatic("/assets/*filepath", handlers.StaticAssets())
|
srv.ServeStatic("/assets/*filepath", http.Dir(config.WebDir+"/assets"))
|
||||||
|
|
||||||
srv.GET("/", hand.Index)
|
srv.GET("/", hand.Index)
|
||||||
srv.POST("/", hand.Upload)
|
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 {
|
if err := srv.Start(config.SplitNetworkAddress()); err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user