18 lines
374 B
Go
18 lines
374 B
Go
package web
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
)
|
|
|
|
func NewHandler() http.Handler {
|
|
mux := http.NewServeMux()
|
|
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
|
|
_ = Index().Render(context.Background(), w)
|
|
})
|
|
mux.HandleFunc("/api/hello", func(w http.ResponseWriter, r *http.Request) {
|
|
_ = Hello("world").Render(context.Background(), w)
|
|
})
|
|
return mux
|
|
}
|