init
This commit is contained in:
24
internal/server/routes.go
Normal file
24
internal/server/routes.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user