25 lines
484 B
Go
25 lines
484 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func (srv *server) routes() http.Handler {
|
|
mux := http.NewServeMux()
|
|
|
|
fileServer := http.FileServer(http.Dir("./ui/static/"))
|
|
mux.Handle("GET /static/", http.StripPrefix("/static", fileServer))
|
|
//mux.Handle("GET /static/", http.FileServerFS(ui.Files))
|
|
|
|
//Configure Middleware chains
|
|
|
|
//Add routes and handlers to map
|
|
routes := map[string]http.Handler{}
|
|
|
|
for path, handler := range routes {
|
|
mux.Handle(path, handler)
|
|
}
|
|
|
|
return mux
|
|
}
|