Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

351 B
Raw Blame
package utils

import (
	"errors"
	"net/http"

	"github.com/go-chi/chi/v5"
)

// GetURLParam retrieves the specified URL param from a given request.
func GetURLParam(r *http.Request, key string) (value string, err error) {
	value = chi.URLParam(r, key)
	if value == "" {
		err = errors.New("request does not contain requested URL param")
	}
	return
}