Documentation Index
Fetch the complete documentation index at: https://mintlify.com/binary-person/rammerhead/llms.txt
Use this file to discover all available pages before exploring further.
URLPath extends the built-in URL class with two convenience methods for reading query parameters. It is used throughout Rammerhead’s route handlers to extract values like id, pwd, httpProxy, and origin from incoming request URLs without the boilerplate of new URL('http://foobar' + req.url).searchParams.get(...).
Source
Constructor
A URL path string such as
/newsession?pwd=secret&foo=bar. The path does not need a scheme or host — a dummy base URL (http://foobar) is used internally so that the standard URL parser can handle root-relative paths.URLPath extends URL, all standard URL properties (pathname, searchParams, href, etc.) are available in addition to the methods below.
Methods
get(param)
Returns the value of a single query parameter, ornull if the parameter is absent.
The name of the query parameter to retrieve.
getParams()
Returns all query parameters as a plain object. Keys are parameter names; values are their string values. When a parameter appears multiple times, the last value wins (standardURLSearchParams behaviour).
Usage in route handlers
URLPath is used in every route handler in setupRoutes.js and RammerheadProxy.js. The following examples reflect real usage from those files.
Checking the password: