Function Signature

Understand the expected format of the HandleRequest function and what it returns.

Function Signature

func HandleRequest(r *http.Request, params map[string]string) (map[string]interface{}, error)
  • r: The incoming HTTP request
  • params: Dynamic route parameters (like slug, id, etc.)
  • Return: A map of values that are passed into the index.html template

This gives you full control to read headers, query strings, cookies, and more. You can also return an error, which Barry will handle gracefully during rendering.