scanfile/server/internal/server/routes.go
2025-06-12 13:00:13 +02:00

23 lines
554 B
Go

package server
import (
"net/http"
"git.jmbit.de/jmb/scanfile/server/api"
"git.jmbit.de/jmb/scanfile/server/web"
)
func RegisterRoutes() *http.ServeMux {
mux := http.NewServeMux()
// Web interface
mux.HandleFunc("/", web.IndexWebHandler)
mux.HandleFunc("/about", web.AboutWebHandler)
mux.HandleFunc("/files/{uuid}", web.FileViewWebHandler)
mux.HandleFunc("POST /upload", web.IndexUploadHandler)
mux.Handle("/assets/", http.FileServer(http.FS(web.Files)))
// REST API
mux.HandleFunc("/api/v0/submit", api.SubmitRestHandler)
return mux
}