feat: better url handling
This commit is contained in:
parent
bce825031f
commit
f225038908
3
main.go
3
main.go
@ -5,7 +5,6 @@ import (
|
|||||||
"leech/config"
|
"leech/config"
|
||||||
"leech/route"
|
"leech/route"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
"github.com/gofiber/fiber/v2/middleware/filesystem"
|
||||||
@ -29,7 +28,7 @@ func main() {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
for dirName, dirToServe := range config.Config.ServeDirs {
|
for dirName, dirToServe := range config.Config.ServeDirs {
|
||||||
app.Static("/serve/"+url.QueryEscape(dirName), dirToServe)
|
app.Static("/serve/"+dirName, dirToServe)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.Use("/", route.HandleList)
|
app.Use("/", route.HandleList)
|
||||||
|
Loading…
Reference in New Issue
Block a user