19 lines
347 B
Go
19 lines
347 B
Go
|
package web
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
|
||
|
"git.kapelle.org/niklas/beerpong-elo/internal/repo"
|
||
|
)
|
||
|
|
||
|
func CreateWebserver(repo repo.Repo) *http.ServeMux {
|
||
|
router := http.NewServeMux()
|
||
|
|
||
|
router.HandleFunc("GET /hello", func(w http.ResponseWriter, r *http.Request) {
|
||
|
fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
|
||
|
})
|
||
|
|
||
|
return router
|
||
|
}
|