Because of how httprouter works I had to create an /index/ endpoint. Also /file/ endpoint serving files was added.
This commit is contained in:
parent
a2a40a6dfe
commit
feda955c38
@ -6,6 +6,7 @@ import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/netip"
|
||||
"os"
|
||||
"os/signal"
|
||||
@ -30,8 +31,8 @@ func main() {
|
||||
srv := server.NewHttpServer()
|
||||
|
||||
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
|
||||
srv.GET("/robots.txt", hand.Robots)
|
||||
srv.GET("/*filepath", hand.Index)
|
||||
srv.ServeStatic("/file/*filepath", http.Dir(*directoryPath))
|
||||
srv.GET("/index/*filepath", hand.Index)
|
||||
|
||||
var network string
|
||||
if !strings.ContainsRune(*listenAddress, ':') {
|
||||
|
Loading…
Reference in New Issue
Block a user