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"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
"net/http"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
@ -30,8 +31,8 @@ func main() {
|
|||||||
srv := server.NewHttpServer()
|
srv := server.NewHttpServer()
|
||||||
|
|
||||||
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
|
srv.ServeStatic("/assets/*filepath", hand.AssetsFS())
|
||||||
srv.GET("/robots.txt", hand.Robots)
|
srv.ServeStatic("/file/*filepath", http.Dir(*directoryPath))
|
||||||
srv.GET("/*filepath", hand.Index)
|
srv.GET("/index/*filepath", hand.Index)
|
||||||
|
|
||||||
var network string
|
var network string
|
||||||
if !strings.ContainsRune(*listenAddress, ':') {
|
if !strings.ContainsRune(*listenAddress, ':') {
|
||||||
|
Loading…
Reference in New Issue
Block a user