The structure of converge server is now much more clear in the package // structure below pkg/server.
28 lines
534 B
Go
28 lines
534 B
Go
package ui
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
func PageHandler(w http.ResponseWriter, r *http.Request) {
|
|
access := getConvergeAccess(r)
|
|
|
|
switch r.URL.Path {
|
|
case "":
|
|
fallthrough
|
|
case "/":
|
|
fallthrough
|
|
case "index.html":
|
|
AboutTab().Render(r.Context(), w)
|
|
// TODO use contexts later.
|
|
case "usage.html":
|
|
UsageTab(access).Render(r.Context(), w)
|
|
case "downloads.html":
|
|
DownloadsTab().Render(r.Context(), w)
|
|
case "sessions.html":
|
|
SessionsTab(nil, nil, access.Location).Render(r.Context(), w)
|
|
default:
|
|
http.NotFound(w, r)
|
|
}
|
|
}
|